Skip to content

Commit 02e7211

Browse files
docs(cli): update skills and docs for manage/generate restructure (#2939)
## Summary Updates all documentation, agent skills, and internal references to reflect the `manage` namespace and `generate ts`/`generate py` restructuring from the previous two PRs. ## Changes - Updated `docs/content/docs/cli.mdx` — all command examples now use `composio manage ...` and `composio generate ts/py` syntax - Updated `docs/content/docs/troubleshooting/cli.mdx` — corrected generation command references - Updated `docs/content/changelog/03-13-26-cli-improvements.mdx` — fixed references to `composio orgs switch` → `composio manage orgs switch` - Updated `ts/packages/cli/AGENTS.md` — command table and code generation pipeline docs - Updated `.claude/skills/implement-cli-command/SKILL.md` — directory structure, file naming conventions, subcommand group examples, and reference table all reflect the new layout - Updated `.claude/skills/create-cli/SKILL.md` — help output examples use `composio generate ts/py` - Updated `.claude/skills/create-cli-e2e/SKILL.md` — e2e test examples use `composio manage tools ...` ## Type of change - [x] Documentation ## How Has This Been Tested? - Documentation changes are text-only; verified formatting renders correctly ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [x] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
1 parent 0ad893d commit 02e7211

File tree

6 files changed

+61
-61
lines changed

6 files changed

+61
-61
lines changed

.claude/skills/create-cli-e2e/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ e2e(import.meta.url, {
225225
it('exits with non-zero code', () => {
226226
expect(missingArgResult.exitCode).not.toBe(0);
227227
});
228-
229228
it('stderr contains an error message', () => {
230229
expect(missingArgResult.stderr).not.toBe('');
231230
});

.claude/skills/create-cli/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ EXAMPLES
176176
$ composio generate --toolkits github,slack --type-tools
177177
178178
COMMANDS
179-
composio ts generate Generate TypeScript stubs
180-
composio py generate Generate Python stubs
179+
composio generate ts Generate TypeScript stubs
180+
composio generate py Generate Python stubs
181181
```
182182

183183
**Suggest next commands** when it helps the user's flow:

.claude/skills/implement-cli-command/SKILL.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ src/
3333
│ ├── login.cmd.ts # Complex command (options, spinner, polling)
3434
│ ├── logout.cmd.ts # Action command (no stdout data)
3535
│ ├── upgrade.cmd.ts # Action command (delegates to service)
36-
│ ├── generate.cmd.ts # Command that auto-delegates to subcommands
36+
│ ├── generate/
37+
│ │ ├── generate.cmd.ts # Parent command group for `composio generate`
38+
│ │ ├── generate-py.cmd.ts # `composio generate py`
39+
│ │ └── generate-ts.cmd.ts # `composio generate ts`
40+
│ ├── manage/
41+
│ │ └── manage.cmd.ts # Parent command group for `composio manage`
3742
│ ├── ts/
38-
│ │ ├── ts.cmd.ts # Parent command group
43+
│ │ ├── ts.cmd.ts # Existing TS generation internals, referenced from generate/
3944
│ │ └── commands/
40-
│ │ └── ts.generate.cmd.ts # Subcommand with complex logic
45+
│ │ └── ts.generate.cmd.ts # Reusable TS generation logic
4146
│ └── py/
42-
│ ├── py.cmd.ts
47+
│ ├── py.cmd.ts # Existing Python generation internals, referenced from generate/
4348
│ └── commands/
4449
│ └── py.generate.cmd.ts
4550
├── services/ # Effect services (dependency injection)
@@ -53,11 +58,11 @@ src/
5358
### File Naming Convention
5459

5560
- Command files: `<name>.cmd.ts` (e.g., `version.cmd.ts`, `login.cmd.ts`)
56-
- Subcommand files: `<parent>.<name>.cmd.ts` inside `commands/` (e.g., `ts.generate.cmd.ts`)
57-
- Parent command groups: `<name>.cmd.ts` at the group level (e.g., `ts/ts.cmd.ts`)
61+
- Subcommand implementation files: `<parent>.<name>.cmd.ts` inside `commands/` (e.g., `ts.generate.cmd.ts`)
62+
- Parent command groups: `<name>.cmd.ts` at the group level (e.g., `generate/generate.cmd.ts`, `manage/manage.cmd.ts`)
63+
- Wrapper subcommand entrypoints can also live beside their parent group (e.g., `generate/generate-py.cmd.ts`, `generate/generate-ts.cmd.ts`)
5864

5965
## Creating a New Command
60-
6166
### Step 1: Create the Command File
6267

6368
Create `src/commands/<name>.cmd.ts`.
@@ -147,8 +152,7 @@ const $cmd = $defaultCmd.pipe(
147152
loginCmd,
148153
logoutCmd,
149154
generateCmd,
150-
pyCmd,
151-
tsCmd,
155+
manageCmd,
152156
myCmd, // Add here
153157
])
154158
);
@@ -175,17 +179,16 @@ For commands like `composio manage toolkits list`, `composio manage toolkits inf
175179
### Step 1: Create the Directory Structure
176180

177181
```
178-
src/commands/toolkits/
179-
├── toolkits.cmd.ts # Parent command group
182+
src/commands/manage/toolkits/
183+
├── toolkits.cmd.ts # Parent command group under `manage`
180184
└── commands/
181185
├── toolkits.list.cmd.ts # composio manage toolkits list
182186
└── toolkits.info.cmd.ts # composio manage toolkits info
183187
```
184188

185189
### Step 2: Create the Parent Command
186190

187-
`src/commands/toolkits/toolkits.cmd.ts`:
188-
191+
`src/commands/manage/toolkits/toolkits.cmd.ts`:
189192
```typescript
190193
import { Command } from '@effect/cli';
191194
import { toolkitsCmd$List } from './commands/toolkits.list.cmd';
@@ -199,8 +202,7 @@ export const toolkitsCmd = Command.make('toolkits').pipe(
199202

200203
### Step 3: Create Each Subcommand
201204

202-
`src/commands/toolkits/commands/toolkits.list.cmd.ts`:
203-
205+
`src/commands/manage/toolkits/commands/toolkits.list.cmd.ts`:
204206
```typescript
205207
import { Command, Options } from '@effect/cli';
206208
import { Effect, Option } from 'effect';
@@ -238,21 +240,22 @@ export const toolkitsCmd$List = Command.make('list', { searchOpt }).pipe(
238240
);
239241
```
240242

241-
### Step 4: Register the Parent in index.ts
243+
### Step 4: Register the Parent in `manage/manage.cmd.ts`
242244

243245
```typescript
246+
import { Command } from '@effect/cli';
244247
import { toolkitsCmd } from './toolkits/toolkits.cmd';
245248

246-
const $cmd = $defaultCmd.pipe(
249+
export const manageCmd = Command.make('manage').pipe(
250+
Command.withDescription('Manage existing Composio resources.'),
247251
Command.withSubcommands([
248-
// ... existing commands
252+
// ... existing manage subcommands
249253
toolkitsCmd,
250254
])
251255
);
252256
```
253257

254258
## Option Declaration Patterns
255-
256259
Options are declared at module level using `@effect/cli`'s `Options` API. The template above demonstrates the most common types (required text, optional text). For other option types, see `ts/vendor/effect/packages/cli/src/Options.ts`.
257260

258261
Both `Options.optional(Options.text(...))` (wrapping) and `Options.text(...).pipe(Options.optional)` (piped) are valid. Use whichever reads better.
@@ -408,8 +411,7 @@ const [toolkits, tools, triggerTypes] = yield* Effect.all(
408411

409412
## Extracting Reusable Logic
410413

411-
For commands that share logic (e.g., `composio generate` delegates to `composio ts generate`):
412-
414+
For commands that share logic (e.g., `composio generate` delegates to `composio generate ts`):
413415
```typescript
414416
// In ts.generate.cmd.ts — export the logic separately
415417
export function generateTypescriptTypeStubs(params: { ... }) {
@@ -425,9 +427,8 @@ export const tsCmd$Generate = Command.make('generate', { ... }).pipe(
425427
);
426428

427429
// Other commands can reuse it
428-
// In generate.cmd.ts
429-
import { generateTypescriptTypeStubs } from './ts/commands/ts.generate.cmd';
430-
430+
// In generate/generate-ts.cmd.ts
431+
import { generateTypescriptTypeStubs } from '../ts/commands/ts.generate.cmd';
431432
yield* Match.value(envLang).pipe(
432433
Match.when('TypeScript', () => generateTypescriptTypeStubs({ ... })),
433434
Match.when('Python', () => generatePythonTypeStubs({ ... })),
@@ -534,10 +535,11 @@ recordings/
534535
| `src/commands/login.cmd.ts` | Complex command (options, spinner, polling, retry) |
535536
| `src/commands/logout.cmd.ts` | Action command (no stdout data) |
536537
| `src/commands/upgrade.cmd.ts` | Action command delegating to service |
537-
| `src/commands/generate.cmd.ts` | Auto-detection and delegation to subcommands |
538-
| `src/commands/ts/commands/ts.generate.cmd.ts` | Full subcommand with parallel fetching, spinner, file I/O |
538+
| `src/commands/generate/generate.cmd.ts` | Parent `generate` command and delegation entrypoint |
539+
| `src/commands/manage/manage.cmd.ts` | Parent `manage` command and subcommand registration |
540+
| `src/commands/ts/commands/ts.generate.cmd.ts` | Reusable TS generation logic used by `generate ts` |
539541
| `src/commands/index.ts` | Command tree registration |
540542
| `src/bin.ts` | Entry point, layer composition, error handling |
541543
| `src/services/terminal-ui.ts` | TerminalUI service interface |
542544
| `src/services/composio-clients.ts` | API client service (HTTP, pagination, metrics) |
543-
| `ts/packages/cli/AGENTS.md` | CLI architecture, services, effects, output conventions |
545+
| `ts/packages/cli/AGENTS.md` | CLI architecture, services, effects, output conventions |

docs/content/changelog/03-13-26-cli-improvements.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ composio link github --no-wait # Prints redirect URL and JSON, exits
4646
The `composio whoami` command no longer displays API keys in the output. This improves security and reduces the risk of accidental exposure in logs or screenshots.
4747

4848
- API key is removed from both display and JSON output.
49-
- Hints for `composio orgs switch` and `composio init` are shown instead.
49+
- Hints for `composio manage orgs switch` and `composio init` are shown instead.
5050

5151
---
5252

@@ -86,4 +86,4 @@ composio init # Interactive project selection
8686

8787
- **Login JSON output**: When using the org/project picker, the JSON output now reflects the final selection (not the initial session state).
8888
- **Picker error handling**: If the org/project picker fails (e.g. API error), the CLI shows a warning, emits JSON with session data, and displays hints so you are not left without guidance.
89-
- **Modularized org/project selection**: The selection logic is shared between `composio login` and `composio orgs switch`.
89+
- **Modularized org/project selection**: The selection logic is shared between `composio login` and `composio manage orgs switch`.

docs/content/docs/cli.mdx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ composio whoami
3333

3434
```bash
3535
# Connect your GitHub account
36-
composio connected-accounts link github
36+
composio manage connected-accounts link github
3737

3838
# Print connect URL + JSON and exit immediately (no wait)
39-
composio connected-accounts link github --no-wait
39+
composio manage connected-accounts link github --no-wait
4040

4141
# Search for tools
42-
composio tools search "star a github repo"
42+
composio manage tools search "star a github repo"
4343

4444
# Look up a tool's input schema
45-
composio tools info GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER
45+
composio manage tools info GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER
4646

4747
# Execute a tool (star the Composio repo!)
48-
composio tools execute GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER -d '{"owner":"composiohq","repo":"composio"}'
48+
composio manage tools execute GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER -d '{"owner":"composiohq","repo":"composio"}'
4949
```
5050

5151
## Set up and listen to triggers
5252

5353
```bash
5454
# Find your connected account ID
55-
composio connected-accounts list --toolkits github
55+
composio manage connected-accounts list --toolkits github
5656

5757
# Create a trigger for star events on your repo
58-
composio triggers create GITHUB_STAR_ADDED_EVENT --connected-account-id your-connected-account-id --trigger-config '{"owner":"your-username","repo":"your-repo"}'
58+
composio manage triggers create GITHUB_STAR_ADDED_EVENT --connected-account-id your-connected-account-id --trigger-config '{"owner":"your-username","repo":"your-repo"}'
5959

6060
# Listen to all GitHub trigger events on your account in real time
61-
composio triggers listen --toolkits github --table
61+
composio manage triggers listen --toolkits github --table
6262
```
6363

6464
## Available commands
@@ -73,15 +73,14 @@ Run `composio <command> --help` for detailed usage and flags.
7373
| `composio logout` | | Remove stored authentication |
7474
| `composio whoami` | | Display your account and workspace information (without API keys) |
7575
| `composio init` | | Initialize a Composio project in the current directory |
76-
| `composio toolkits` | `list`, `search`, `info`, `version` | Discover and inspect toolkits |
77-
| `composio tools` | `list`, `search`, `info`, `execute` | Discover, inspect, and execute tools |
78-
| `composio connected-accounts` | `list`, `info`, `whoami`, `link`, `delete` | Manage connected accounts |
79-
| `composio auth-configs` | `list`, `info`, `create`, `delete` | Manage auth configurations |
80-
| `composio triggers` | `list`, `info`, `create`, `status`, `listen`, `enable`, `disable`, `delete` | Subscribe to events and manage trigger instances |
81-
| `composio logs` | `tools`, `triggers` | Inspect tool and trigger execution logs |
82-
| `composio generate` | | Generate type stubs (auto-detects language) |
83-
| `composio ts` | `generate` | Generate TypeScript type stubs |
84-
| `composio py` | `generate` | Generate Python type stubs |
76+
| `composio manage toolkits` | `list`, `search`, `info`, `version` | Discover and inspect toolkits |
77+
| `composio manage tools` | `list`, `search`, `info`, `execute` | Discover, inspect, and execute tools |
78+
| `composio manage connected-accounts` | `list`, `info`, `whoami`, `link`, `delete` | Manage connected accounts |
79+
| `composio manage auth-configs` | `list`, `info`, `create`, `delete` | Manage auth configurations |
80+
| `composio manage triggers` | `list`, `info`, `create`, `status`, `listen`, `enable`, `disable`, `delete` | Subscribe to events and manage trigger instances |
81+
| `composio manage logs` | `tools`, `triggers` | Inspect tool and trigger execution logs |
82+
| `composio generate ts` | `(options)` | Generate TypeScript type stubs |
83+
| `composio generate py` | `(options)` | Generate Python type stubs |
8584
| `composio upgrade` | | Upgrade CLI to the latest version |
8685
| `composio version` | | Display the current CLI version |
8786

ts/packages/cli/AGENTS.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ Errors are captured via the custom `effect-errors/` module, which provides sourc
2727

2828
Each command is declared with `@effect/cli`'s `Command.make()` pattern:
2929

30-
| Command | Description |
31-
| -------------------------------------------------------- | ----------------------------------------------------------- |
32-
| `composio version` | Display CLI version |
33-
| `composio whoami` | Show logged-in user's API key |
34-
| `composio login [--no-browser] [--no-wait] [--key text]` | Login with browser redirect |
35-
| `composio logout` | Clear stored API key |
36-
| `composio upgrade` | Self-update binary from GitHub releases |
37-
| `composio generate` | Auto-detect project language, delegate to `ts` or `py` |
38-
| `composio ts generate` | Generate TypeScript type stubs for toolkits/tools/triggers |
39-
| `composio py generate` | Generate Python type stubs |
40-
| `composio manage <subcommand>` | Manage Composio resources (toolkits, tools, accounts, etc.) |
30+
| Command | Description |
31+
| -------------------------------------------------------- | ---------------------------------------------------------- |
32+
| `composio version` | Display CLI version |
33+
| `composio whoami` | Show logged-in user's API key |
34+
| `composio login [--no-browser] [--no-wait] [--key text]` | Login with browser redirect |
35+
| `composio logout` | Clear stored API key |
36+
| `composio upgrade` | Self-update binary from GitHub releases |
37+
| `composio generate` | Auto-detect project language, delegate to `ts` or `py` |
38+
| `composio generate ts` | Generate TypeScript type stubs for toolkits/tools/triggers |
39+
| `composio generate py` | Generate Python type stubs |
40+
| `composio manage <command>` | Manage Composio resources (toolkits, tools, accounts, triggers, logs, orgs, projects) |
4141

4242
Options use `Options.text()`, `Options.boolean()`, `Options.choice()`, `Options.directory()` with Effect Schema validation.
4343

@@ -86,7 +86,7 @@ Each model has `fromJSON`/`toJSON` helpers using `JSONTransformSchema()`.
8686

8787
### Code Generation (`src/generation/`)
8888

89-
Multi-stage pipeline for `composio ts generate` and `composio py generate`:
89+
Multi-stage pipeline for `composio generate ts` and `composio generate py`:
9090

9191
1. **Fetch** — Toolkits, tools, trigger types from API (optionally filtered by `--toolkits`)
9292
2. **Index** — Groups tools/triggers by toolkit prefix into a `ToolkitIndex` map

0 commit comments

Comments
 (0)