···4444| **Validation** | **zod** | Validates inputs & generates schemas for LLMs. |
4545| **Interactivity** | **@inquirer/prompts** | Modern prompts for humans. |
4646| **Formatting** | **cli-table3** | **New:** For gh-style pretty tables in Human Mode. |
4747+| **OS Keychain** | **keytar** | **New:** To securely store session tokens in the OS keychain. |
47484849## 5. Agent Integration (The "LLM Friendly" Layer)
4950···112113 `tangled issue create "<title>" [--body "<body>" | --body-file <file> | -F -]`
113114- Creates a new issue in the current repository with the given title and optional body, which can be provided via flag, file, or stdin.
114115115115-## 7. Task Management
116116+## 8. Design Decisions & Outstanding Issues
116117117117-We're bootstrapping task tracking with TODO.md, but will migrate all tasks into Tangled issues and dog food the product as soon as we have basic issue creation and listing working.
118118+This section documents key design decisions and tracks outstanding architectural questions.
118119119119-## 8. Outstanding Issues
120120+### 1. (Resolved) SSH Key Management (`gh` Compatibility)
120121121121-1. Can we allow auth through the web browser, rather than just CLI username/password? This would be more secure and user-friendly.
122122-2. The GitHub CLI manages the private keys allowing you to authenticate git operations. Can we do something similar, or will users have to manage SSH keys separately? Currently, I store my SSH keys in 1Password which signs requests for me. It would be great if tangled CLI could detect this and use it seamlessly, itentifying the user by the signed ssh key.
123123-3. How should we handle storing the AT Proto session securely? The GitHub CLI uses the OS keychain. We could do something similar. How does this work across different platforms (Windows, macOS, Linux)? We want to avoid storing sensitive tokens in plaintext files.
124124-4. How are settings resolved (e.g. local config file, home folder, command-line flags)? We should define a clear precedence order.122122+* **Original Question:** How does `gh` manage SSH keys, and can we follow that pattern?
123123+* **Resolution:** Analysis shows that `gh` does *not* manage private keys. It facilitates uploading the user's *public* key to their GitHub account. The local SSH agent handles the private key.
124124+* **Our Approach:** The `tangled ssh-key add` command follows this exact pattern. It provides a user-friendly way to upload a public key to `tangled.org`. This resolves the core of this issue, as it is compatible with external key managers like 1Password's SSH agent.
125125+126126+### 2. (Decided) Secure Session Storage
127127+128128+* **Original Question:** How should we securely store the AT Proto session token?
129129+* **Resolution:** Storing sensitive tokens in plaintext files is not secure.
130130+* **Our Approach:** The CLI will use the operating system's native keychain for secure storage (e.g., macOS Keychain, Windows Credential Manager, or Secret Service on Linux). A library like `keytar` will be used to abstract the platform differences.
131131+132132+### 3. (Decided) Configuration Resolution Order
133133+134134+* **Original Question:** How should settings be resolved from different sources?
135135+* **Resolution:** A clear precedence order is necessary.
136136+* **Our Approach:** The CLI will resolve settings in the following order of precedence (highest first):
137137+ 1. Command-line flags (e.g., `--repo-did ...`)
138138+ 2. Environment variables (e.g., `TANGLED_REPO_DID=...`)
139139+ 3. Project-specific config file (e.g., `.tangled/config.yml` in the current directory)
140140+ 4. Global user config file (e.g., `~/.config/tangled/config.yml`)
141141+142142+### 4. (Outstanding) Web-based Authentication Flow
143143+144144+* **Original Question:** Can we allow auth through a web browser?
145145+* **Status:** This remains an outstanding issue. The standard AT Protocol authentication flow is based on user handles and app passwords, not a third-party OAuth2 flow like GitHub CLI uses.
146146+* **Path Forward:** Implementing a web-based auth flow would require custom development on the `tangled.org` service itself to securely generate and transmit a session token back to the CLI. This is out of scope for the initial version of the CLI.
147147+148148+## 9. Future Expansion Opportunities
149149+150150+The analysis of the `tangled.org` API revealed a rich set of features that are not yet part of the initial CLI plan but represent significant opportunities for future expansion. These include:
151151+152152+* **Pull Requests:** A full suite of commands for creating, viewing, listing, merging, and commenting on pull requests.
153153+* **CI/CD Pipelines:** Commands to view pipeline status and manage CI/CD jobs.
154154+* **Repository Secrets:** A dedicated command set for managing CI/CD secrets within a repository (`tangled repo secret ...`).
155155+* **Advanced Git Operations:** Commands to interact with the commit log, diffs, branches, and tags directly via the API, augmenting local `git` commands.
156156+* **Social & Feed Interactions:** Commands for starring repositories, reacting to feed items, and managing the user's social graph (following/unfollowing).
157157+* **Label Management:** Commands to create, apply, and remove labels from issues and pull requests.
158158+* **Collaboration:** Commands to manage repository collaborators.
159159+* **Fork Management:** Commands for forking repositories and managing the sync status of forks.
160160+161161+## 10. Task Management
162162+163163+We're bootstrapping task tracking with TODO.md, but will migrate all tasks into Tangled issues and dog food the product as soon as we have basic issue creation and listing working.
+1-1
TODO.md
···11111212## 2. Authentication (Auth)
1313- [ ] Implement `tangled auth login` command.
1414- - [ ] Explore methods for secure AT Proto session storage (OS keychain consideration across platforms: Windows, macOS, Linux).
1414+ - [ ] Implement session storage using an OS keychain library (e.g., `keytar`) for secure, cross-platform token management.
1515 - [ ] Integrate `@atproto/api` for XRPC client and session management.
1616 - [ ] Investigate web browser authentication flow.
1717- [ ] Implement `tangled auth logout` command.