feat(cli): add tool setup command + GitHub setup schema (#438)

* feat(cli): add `tool setup` command + GitHub setup schema

- Add `ironclaw tool setup <name>` CLI command that reads
  `setup.required_secrets` from a tool's capabilities file and
  prompts the user for each secret, saving them to the encrypted
  secrets store. Handles already-configured secrets (ask to replace),
  optional secrets (skip on empty), and hidden input.

- Add `setup.required_secrets` to GitHub tool capabilities file
  with `github_token` — the only WASM tool that was missing it
  after PR #437 added setup schemas to all other tools.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor(cli): extract init_secrets_store helper + add tool name validation

Address PR review feedback:
- Extract duplicated secrets store initialization (~50 lines) from
  auth_tool and setup_tool into shared init_secrets_store() helper
- Add validate_tool_name() to reject path traversal in tool names
  (applies to both auth_tool and setup_tool)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
Henry Park
2026-03-01 06:55:57 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 98467a553e
commit b987464f45
2 changed files with 190 additions and 34 deletions
@@ -34,6 +34,14 @@
]
}
},
"setup": {
"required_secrets": [
{
"name": "github_token",
"prompt": "GitHub Personal Access Token (from github.com/settings/tokens)"
}
]
},
"config": {
"default_limit": 30,
"max_limit": 100