{ "cells": [ { "cell_type": "markdown", "id": "cd9ec675", "metadata": {}, "source": [ "# Getting Started\n", "\n", "\n", "## Installation\n", "\n", "The coasti installer is build as python package. In order to use it, you will need to work in a terminal.\n", "\n", "The easiest way to get the coasti installer is via [uv](https://docs.astral.sh/uv/getting-started/installation/).\n", "\n", "### Get UV\n" ] }, { "cell_type": "code", "execution_count": 35, "id": "dfaf8360", "metadata": { "language": "shell-session", "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "downloading uv 0.10.11 aarch64-apple-darwin\n", "no checksums to verify\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "installing to /Users/paul/.local/bin\n", " uv\n", " uvx\n", "everything's installed!\n" ] } ], "source": [ "%%bash\n", "# linux, macos\n", "curl -LsSf https://astral.sh/uv/install.sh | sh" ] }, { "cell_type": "code", "execution_count": null, "id": "168a9b0e", "metadata": { "vscode": { "languageId": "powershell" } }, "outputs": [], "source": [ "%%powershell\n", "# windows\n", "powershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"" ] }, { "cell_type": "code", "execution_count": null, "id": "7723e1c7", "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/Users/paul/para/3_Areas/lf_repos.nosync/coasti_installer/.venv/bin/python: No module named uv\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "%%bash\n", "uv --help" ] }, { "cell_type": "markdown", "id": "35519cf8", "metadata": {}, "source": [ "### Get the Coasti Installer" ] }, { "cell_type": "code", "execution_count": 33, "id": "835424d3", "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[2mResolved \u001b[1m32 packages\u001b[0m \u001b[2min 1.67s\u001b[0m\u001b[0m\n", "\u001b[2mPrepared \u001b[1m2 packages\u001b[0m \u001b[2min 238ms\u001b[0m\u001b[0m\n", "\u001b[2mInstalled \u001b[1m32 packages\u001b[0m \u001b[2min 29ms\u001b[0m\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mannotated-doc\u001b[0m\u001b[2m==0.0.4\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mannotated-types\u001b[0m\u001b[2m==0.7.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mclick\u001b[0m\u001b[2m==8.3.1\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mcoasti\u001b[0m\u001b[2m==0.2.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mcolorama\u001b[0m\u001b[2m==0.4.6\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mcopier\u001b[0m\u001b[2m==9.14.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mdunamai\u001b[0m\u001b[2m==1.26.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mfuncy\u001b[0m\u001b[2m==2.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mjinja2\u001b[0m\u001b[2m==3.1.6\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mjinja2-ansible-filters\u001b[0m\u001b[2m==1.3.2\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mmarkdown-it-py\u001b[0m\u001b[2m==4.0.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mmarkupsafe\u001b[0m\u001b[2m==3.0.3\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mmdurl\u001b[0m\u001b[2m==0.1.2\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpackaging\u001b[0m\u001b[2m==26.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpathspec\u001b[0m\u001b[2m==1.0.4\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mplatformdirs\u001b[0m\u001b[2m==4.9.4\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mplumbum\u001b[0m\u001b[2m==1.10.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mprompt-toolkit\u001b[0m\u001b[2m==3.0.52\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpydantic\u001b[0m\u001b[2m==2.12.5\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpydantic-core\u001b[0m\u001b[2m==2.41.5\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpygments\u001b[0m\u001b[2m==2.19.2\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpython-dotenv\u001b[0m\u001b[2m==1.2.2\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mpyyaml\u001b[0m\u001b[2m==6.0.3\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mquestionary\u001b[0m\u001b[2m==2.1.1\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mrich\u001b[0m\u001b[2m==14.3.3\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mruamel-yaml\u001b[0m\u001b[2m==0.19.1\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mshellingham\u001b[0m\u001b[2m==1.5.4\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mtyper\u001b[0m\u001b[2m==0.24.1\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mtyping-extensions\u001b[0m\u001b[2m==4.15.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mtyping-inspection\u001b[0m\u001b[2m==0.4.2\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mwcwidth\u001b[0m\u001b[2m==0.6.0\u001b[0m\n", " \u001b[32m+\u001b[39m \u001b[1mxkcdpass\u001b[0m\u001b[2m==1.30.0\u001b[0m\n", "Installed 1 executable: \u001b[1mcoasti\u001b[0m\n" ] } ], "source": [ "%%bash\n", "uv tool install coasti" ] }, { "cell_type": "code", "execution_count": 34, "id": "ae28b8db", "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1m \u001b[0m\n", "\u001b[1m \u001b[0m\u001b[1;33mUsage: \u001b[0m\u001b[1mcoasti [OPTIONS] COMMAND [ARGS]...\u001b[0m\u001b[1m \u001b[0m\u001b[1m \u001b[0m\n", "\u001b[1m \u001b[0m\n", " Coasti Installer - Initialize projects and install products. \n", " \n", "\u001b[2m╭─\u001b[0m\u001b[2m Options \u001b[0m\u001b[2m───────────────────────────────────────────────────────────────────\u001b[0m\u001b[2m─╮\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36m-\u001b[0m\u001b[1;36m-verbose\u001b[0m \u001b[1;32m-v\u001b[0m \u001b[1;33mINTEGER\u001b[0m Increase verbosity (\u001b[1;32m-v\u001b[0m, \u001b[1;32m-vv\u001b[0m, \u001b[1;32m-vvv\u001b[0m) \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[2m[default: 0] \u001b[0m \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36m-\u001b[0m\u001b[1;36m-quiet\u001b[0m \u001b[1;32m-q\u001b[0m \u001b[1;33m \u001b[0m Avoid user prompts \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36m-\u001b[0m\u001b[1;36m-install\u001b[0m\u001b[1;36m-completion\u001b[0m \u001b[1;33m \u001b[0m Install completion for the current \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m shell. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36m-\u001b[0m\u001b[1;36m-show\u001b[0m\u001b[1;36m-completion\u001b[0m \u001b[1;33m \u001b[0m Show completion for the current \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m shell, to copy it or customize the \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m installation. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36m-\u001b[0m\u001b[1;36m-help\u001b[0m \u001b[1;33m \u001b[0m Show this message and exit. \u001b[2m│\u001b[0m\n", "\u001b[2m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", "\u001b[2m╭─\u001b[0m\u001b[2m Commands \u001b[0m\u001b[2m──────────────────────────────────────────────────────────────────\u001b[0m\u001b[2m─╮\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36mversion\u001b[0m\u001b[1;36m \u001b[0m Shows the version of the coasti installer. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36minit \u001b[0m\u001b[1;36m \u001b[0m Initialize a coasti workspace \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[1;36mproduct\u001b[0m\u001b[1;36m \u001b[0m List, add or update products. \u001b[2m│\u001b[0m\n", "\u001b[2m╰──────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", "\n", "\u001b[0m" ] } ], "source": [ "%%bash\n", "coasti --help" ] }, { "cell_type": "markdown", "id": "e17e4ad5", "metadata": {}, "source": [ "## Creating a new project\n", "\n", "One central idea of coasti is that projects follow a specific folder structure.\n", "This helps all installed tools and components to find what they need.\n", "\n", "The installer can create this structure for us. If you are setting the project up on a server, we suggest placing it in `/coasti`, but here I am just using my home folder." ] }, { "cell_type": "code", "execution_count": null, "id": "ba8986c7", "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\n", "Copying from template version 0.2.0\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m tools\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m tools/.gitkeep\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m products\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m products/.gitkeep\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m .gitignore\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/secrets\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/secrets/sample_pass\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/secrets/vcs_auth_coasti\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/products.yml\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/install_answers.yml\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m config/tools.yml\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m logs\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m logs/.gitkeep\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m data\n", "\u001b[32m\u001b[1m create\u001b[39m\u001b[0m data/.gitkeep\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m > Running task 1 of 4: git init\u001b[39m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Initialized empty Git repository in /Users/paul/coasti_project/.git/\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m > Running task 2 of 4: git add .\u001b[39m\n", "\u001b[34m > Running task 3 of 4: git commit -m \"Coasti init\"\u001b[39m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[main (root-commit) f6d5483] Coasti init\n", " 6 files changed, 57 insertions(+)\n", " create mode 100644 .gitignore\n", " create mode 100644 config/install_answers.yml\n", " create mode 100644 config/products.yml\n", " create mode 100644 config/tools.yml\n", " create mode 100644 products/.gitkeep\n", " create mode 100644 tools/.gitkeep\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Coasti folder structure created at \"/Users/paul/coasti_project\"\n", "\n", "Next steps:\n", "\n", "- Change directory to the project root:\n", " cd /Users/paul/coasti_project\n", "\n", "- See \"README.md\" and start coding.\n", "\n", "- To add products, see:\n", " coasti product --help\n", "\n", "- Push the local repo to your remote origin:\n", " git push --set-upstream origin main\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[0m" ] } ], "source": [ "%%bash\n", "coasti init /Users/paul/coasti_project" ] }, { "cell_type": "markdown", "id": "f7e87b3f", "metadata": {}, "source": [ "Let's have a look at the created folder structure." ] }, { "cell_type": "code", "execution_count": 5, "id": "34aecad5", "metadata": { "vscode": { "languageId": "shellscript" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1;36m/Users/paul/coasti_project\u001b[0m\n", "├── \u001b[1;36mconfig\u001b[0m\n", "│   ├── install_answers.yml\n", "│   ├── products.yml\n", "│   ├── \u001b[1;36msecrets\u001b[0m\n", "│   │   ├── sample_pass\n", "│   │   └── vcs_auth_coasti\n", "│   └── tools.yml\n", "├── \u001b[1;36mdata\u001b[0m\n", "├── \u001b[1;36mlogs\u001b[0m\n", "├── \u001b[1;36mproducts\u001b[0m\n", "└── \u001b[1;36mtools\u001b[0m\n", "\n", "6 directories, 5 files\n" ] } ], "source": [ "%%bash\n", "tree /Users/paul/coasti_project" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.3" } }, "nbformat": 4, "nbformat_minor": 5 }