From b50006f474d2c82892cd76262fd45b4d97fc4167 Mon Sep 17 00:00:00 2001 From: dzejkop Date: Tue, 7 Jul 2026 21:05:05 +0200 Subject: [PATCH] rename bin to `tang` --- AGENTS.md | 2 +- README.md | 38 ++++++++--------- crates/tangled-cli/Cargo.toml | 5 +++ crates/tangled-cli/src/cli.rs | 2 +- docs/getting-started.md | 78 +++++++++++++++++------------------ 5 files changed, 65 insertions(+), 60 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 84e803d..63506d5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -275,7 +275,7 @@ systemctl --user enable --now gnome-keyring-daemon ### Repository Not Found -- Verify repo exists: `tangled repo info owner/name` +- Verify repo exists: `tang repo info owner/name` - Check you're using the correct owner (handle or DID) - Ensure you have access permissions diff --git a/README.md b/README.md index 5111e2b..6112ad3 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Requires Rust toolchain (1.70+) and network access to fetch dependencies. cargo build --release ``` -The binary will be available at `target/release/tangled-cli`. +The binary will be available at `target/release/tang`. ### Install from AUR (Arch Linux) @@ -71,27 +71,27 @@ yay -S tangled-cli-git ## Quick Start Top-level commands are the convenient, git-context-aware interface. The explicit -API-shaped command tree is also available under `tangled api ...`, for example -`tangled api repo list` or `tangled api pr create --repo owner/name --base main --head branch`. +API-shaped command tree is also available under `tang api ...`, for example +`tang api repo list` or `tang api pr create --repo owner/name --base main --head branch`. 1. **Login to Tangled**: ```sh - tangled auth login --handle your.handle.bsky.social + tang auth login --handle your.handle.bsky.social ``` 2. **List your repositories**: ```sh - tangled repo list + tang repo list ``` 3. **Create a new repository**: ```sh - tangled repo create myproject --description "My cool project" + tang repo create myproject --description "My cool project" ``` 4. **Clone a repository**: ```sh - tangled repo clone username/reponame + tang repo clone username/reponame ``` ## Workspace Structure @@ -120,46 +120,46 @@ The CLI stores session credentials securely in your system keyring and configura ```sh # Create an issue -tangled issue create --repo myrepo --title "Bug: Fix login" --body "Description here" +tang issue create --repo myrepo --title "Bug: Fix login" --body "Description here" # List issues -tangled issue list --repo myrepo +tang issue list --repo myrepo # Comment on an issue -tangled issue comment --body "I'll fix this" +tang issue comment --body "I'll fix this" ``` ### Working with Pull Requests ```sh # Create a PR from the current git repository and branch -tangled pr create +tang pr create # Or create a PR explicitly -tangled pr create --repo myrepo --base main --head feature-branch --title "Add new feature" +tang pr create --repo myrepo --base main --head feature-branch --title "Add new feature" # Review a PR -tangled pr review --approve --comment "LGTM!" +tang pr review --approve --comment "LGTM!" # Merge a PR -tangled pr merge +tang pr merge ``` ### CI/CD with Spindle ```sh # Enable spindle for your repo -tangled spindle config --repo myrepo --enable +tang spindle config --repo myrepo --enable # List pipeline runs -tangled spindle list --repo myrepo +tang spindle list --repo myrepo # Stream logs from a workflow -tangled spindle logs knot:rkey:workflow-name --follow +tang spindle logs knot:rkey:workflow-name --follow # Manage secrets -tangled spindle secret add --repo myrepo --key API_KEY --value "secret-value" -tangled spindle secret list --repo myrepo +tang spindle secret add --repo myrepo --key API_KEY --value "secret-value" +tang spindle secret list --repo myrepo ``` ## Development diff --git a/crates/tangled-cli/Cargo.toml b/crates/tangled-cli/Cargo.toml index 0e49302..200f561 100644 --- a/crates/tangled-cli/Cargo.toml +++ b/crates/tangled-cli/Cargo.toml @@ -4,6 +4,11 @@ version = "0.1.0" edition = "2021" description = "CLI for interacting with Tangled (AT Protocol-based git collaboration)." license = "MIT OR Apache-2.0" +autobins = false + +[[bin]] +name = "tang" +path = "src/main.rs" [dependencies] anyhow = { workspace = true } diff --git a/crates/tangled-cli/src/cli.rs b/crates/tangled-cli/src/cli.rs index a4913e1..0ea9b69 100644 --- a/crates/tangled-cli/src/cli.rs +++ b/crates/tangled-cli/src/cli.rs @@ -1,7 +1,7 @@ use clap::{Args, Parser, Subcommand, ValueEnum}; #[derive(Parser, Debug, Clone)] -#[command(name = "tangled", author, version, about = "Tangled CLI", long_about = None)] +#[command(name = "tang", author, version, about = "Tangled CLI", long_about = None)] pub struct Cli { /// Config file path override #[arg(long, global = true)] diff --git a/docs/getting-started.md b/docs/getting-started.md index 439097c..f79acaf 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -23,9 +23,9 @@ This guide will help you get up and running with the Tangled CLI. cargo build --release ``` -3. The binary will be available at `target/release/tangled-cli`. Optionally, add it to your PATH or create an alias: +3. The binary will be available at `target/release/tang`. Optionally, add it to your PATH or create an alias: ```sh - alias tangled='./target/release/tangled-cli' + alias tang='./target/release/tang' ``` ### Install from AUR (Arch Linux) @@ -40,20 +40,20 @@ yay -S tangled-cli-git Top-level commands are optimized for day-to-day use and can infer context from a Tangled git remote where possible. The explicit API-shaped command tree remains -available under `tangled api ...`, such as `tangled api repo list`. +available under `tang api ...`, such as `tang api repo list`. ### 1. Authenticate Login with your AT Protocol credentials (your Bluesky account): ```sh -tangled auth login +tang auth login ``` You'll be prompted for your handle (e.g., `alice.bsky.social`) and password. If you're using a custom PDS, specify it with the `--pds` flag: ```sh -tangled auth login --pds https://your-pds.example.com +tang auth login --pds https://your-pds.example.com ``` Your credentials are stored securely in your system keyring. @@ -63,7 +63,7 @@ Your credentials are stored securely in your system keyring. Verify you're logged in: ```sh -tangled auth status +tang auth status ``` ### 3. List Your Repositories @@ -71,13 +71,13 @@ tangled auth status See all your repositories: ```sh -tangled repo list +tang repo list ``` Or view someone else's public repositories: ```sh -tangled repo list --user alice.bsky.social +tang repo list --user alice.bsky.social ``` ### 4. Create a Repository @@ -85,13 +85,13 @@ tangled repo list --user alice.bsky.social Create a new repository on Tangled: ```sh -tangled repo create my-project --description "My awesome project" +tang repo create my-project --description "My awesome project" ``` By default, repositories are created on the default knot (`knot1.tangled.sh`). You can specify a different knot: ```sh -tangled repo create my-project --knot knot1.tangled.sh +tang repo create my-project --knot knot1.tangled.sh ``` ### 5. Clone a Repository @@ -99,13 +99,13 @@ tangled repo create my-project --knot knot1.tangled.sh Clone a repository to start working on it: ```sh -tangled repo clone alice/my-project +tang repo clone alice/my-project ``` This uses SSH by default. For HTTPS: ```sh -tangled repo clone alice/my-project --https +tang repo clone alice/my-project --https ``` ## Working with Issues @@ -113,25 +113,25 @@ tangled repo clone alice/my-project --https ### Create an Issue ```sh -tangled issue create --repo my-project --title "Add new feature" --body "We should add feature X" +tang issue create --repo my-project --title "Add new feature" --body "We should add feature X" ``` ### List Issues ```sh -tangled issue list --repo my-project +tang issue list --repo my-project ``` ### View Issue Details ```sh -tangled issue show +tang issue show ``` ### Comment on an Issue ```sh -tangled issue comment --body "I'm working on this!" +tang issue comment --body "I'm working on this!" ``` ## Working with Pull Requests @@ -140,10 +140,10 @@ tangled issue comment --body "I'm working on this!" ```sh # From inside a Tangled repo checkout, infer repo/base/head and prompt for details -tangled pr create +tang pr create # Or provide every field explicitly -tangled pr create --repo my-project --base main --head feature-branch --title "Add feature X" +tang pr create --repo my-project --base main --head feature-branch --title "Add feature X" ``` The CLI will use `git format-patch` to create a patch from your branch. @@ -151,25 +151,25 @@ The CLI will use `git format-patch` to create a patch from your branch. ### List Pull Requests ```sh -tangled pr list --repo my-project +tang pr list --repo my-project ``` ### Review a Pull Request ```sh -tangled pr review --approve --comment "Looks good!" +tang pr review --approve --comment "Looks good!" ``` Or request changes: ```sh -tangled pr review --request-changes --comment "Please fix the tests" +tang pr review --request-changes --comment "Please fix the tests" ``` ### Merge a Pull Request ```sh -tangled pr merge +tang pr merge ``` ## CI/CD with Spindle @@ -179,25 +179,25 @@ Spindle is Tangled's integrated CI/CD system. ### Enable Spindle for Your Repository ```sh -tangled spindle config --repo my-project --enable +tang spindle config --repo my-project --enable ``` Or use a custom spindle URL: ```sh -tangled spindle config --repo my-project --url https://my-spindle.example.com +tang spindle config --repo my-project --url https://my-spindle.example.com ``` ### View Pipeline Runs ```sh -tangled spindle list --repo my-project +tang spindle list --repo my-project ``` ### Stream Workflow Logs ```sh -tangled spindle logs knot:rkey:workflow-name +tang spindle logs knot:rkey:workflow-name ``` Add `--follow` to tail the logs in real-time. @@ -207,19 +207,19 @@ Add `--follow` to tail the logs in real-time. Add secrets for your CI/CD workflows: ```sh -tangled spindle secret add --repo my-project --key API_KEY --value "my-secret-value" +tang spindle secret add --repo my-project --key API_KEY --value "my-secret-value" ``` List secrets: ```sh -tangled spindle secret list --repo my-project +tang spindle secret list --repo my-project ``` Remove a secret: ```sh -tangled spindle secret remove --repo my-project --key API_KEY +tang spindle secret remove --repo my-project --key API_KEY ``` ## Advanced Topics @@ -229,7 +229,7 @@ tangled spindle secret remove --repo my-project --key API_KEY Move a repository to a different knot: ```sh -tangled knot migrate --repo my-project --to knot2.tangled.sh +tang knot migrate --repo my-project --to knot2.tangled.sh ``` This command must be run from within the repository's working directory, and your working tree must be clean and pushed. @@ -239,7 +239,7 @@ This command must be run from within the repository's working directory, and you Most commands support JSON output: ```sh -tangled repo list --format json +tang repo list --format json ``` ### Quiet and Verbose Modes @@ -247,13 +247,13 @@ tangled repo list --format json Reduce output: ```sh -tangled --quiet repo list +tang --quiet repo list ``` Increase verbosity for debugging: ```sh -tangled --verbose repo list +tang --verbose repo list ``` ## Configuration @@ -290,7 +290,7 @@ systemctl --user enable --now gnome-keyring-daemon If authentication fails with your custom PDS: ```sh -tangled auth login --pds https://your-pds.example.com +tang auth login --pds https://your-pds.example.com ``` Make sure the PDS URL is correct and accessible. @@ -300,7 +300,7 @@ Make sure the PDS URL is correct and accessible. Verify the repository exists and you have access: ```sh -tangled repo info owner/reponame +tang repo info owner/reponame ``` ## Getting Help @@ -308,14 +308,14 @@ tangled repo info owner/reponame For command-specific help, use the `--help` flag: ```sh -tangled --help -tangled repo --help -tangled repo create --help +tang --help +tang repo --help +tang repo create --help ``` ## Next Steps -- Explore all available commands with `tangled --help` +- Explore all available commands with `tang --help` - Set up CI/CD workflows with `.tangled.yml` in your repository - Check out the main README for more examples and advanced usage -- 2.51.2