Commit Graph

25 Commits

Author SHA1 Message Date
Alberto Schiabel 0abc629f5d refactor(cli): migrate to Effect 4 (4.0.0-rc.112) (#3901)
Rebuilds the Effect v4 port on top of `next` at `effect@4.0.0-rc.112`
(the newest release that clears the repository's 3-day
`minimumReleaseAge` gate). The three v3-compatible preparation PRs
(#4358, #4359, #4360) already landed on `next`, so this PR is now only
the cutover.

## What changes

- Pins `effect`, `@effect/platform-bun`, and `@effect/vitest` to exact
`4.0.0-rc.112`; drops `@effect/cli`, `@effect/platform`,
`@effect/platform-node`, and the `toml` override that existed only for
`@effect/cli`. The `ts/vendor/effect` source oracle moves to the
`effect@4.0.0-rc.112` release commit.
- Services become `Context.Service` classes with explicit `Default`
layers; `Either` becomes `Result`; `ParseResult` becomes
`Schema.SchemaError`; platform modules come from `effect/FileSystem`,
`effect/Path`, `effect/PlatformError`, `effect/unstable/process`, and
`effect/unstable/http`.
- The runner drives `Command.runWith` with v4's default help and error
rendering. `CliError.ShowHelp` carries its own exit code, help for
non-explicit invocations renders on stderr, and "Did you mean?"
suggestions render. `command-introspection.ts` is gone: v4 renders the
resolved command's help and the "missing value" tip itself.
- `composio --version`, `composio -v`, and `composio version` print the
same bare semver (`GlobalFlag.Version` is not enabled; the flag
spellings are rewritten to the `version` command before parsing).
- Root `--log-level` is a shared flag applied after the subcommand tree
is attached, so `composio --log-level Debug <subcommand>` both parses
and takes effect.
- Every `Flag.boolean` carries an explicit default, because rc.112 makes
boolean flags required when omitted.
- A `Result` is not an `Effect` at runtime in rc.112 even though the
type checker accepts `yield*` on it (the fiber dies with "Not a valid
effect"); every `Result` is lifted with `Effect.fromResult`, and the
skill/AGENTS guidance says so.
- Every `ChildProcess.make` site passes `extendEnv: true`, because
rc.112 no longer inherits the parent environment by default.
- `--log-level` and `COMPOSIO_LOG_LEVEL` are exact-match on the
`LogLevel` names (`All`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`,
`Trace`, `None`) with no case folding, per the earlier review decision;
README updated.
- Spawned children pass `extendEnv: true`, because rc.112's
`ChildProcess` no longer inherits the parent environment by default.
- ISO timestamps decode through `Schema.DateTimeUtcFromString`;
`Schema.DateTimeUtc` is no longer a string codec in rc.112.
- `ConfigProvider.fromEnv()` snapshots the environment at construction
in v4, so providers that must observe later changes are built per read
(`plugin-hint.ts`, `install.cmd.ts`, `config.ts`) and tests use a
live-env provider helper.
- `cli-keyring` and `json-schema-to-effect-schema` are ported alongside
(the latter on `Schema.makeFilter`).
- The `effect-v4` skill, the `cli-command` and `typescript-testing`
references, `ts/packages/cli/AGENTS.md`, and the oxlint config are
updated to the rc.112 reality. The skill's example checker
(`.agents/skills/effect-v4/scripts/check-examples.mjs`, lifted from
#3851) compiles every TypeScript block in the skill against the pinned
packages.
- The `js-yaml` overrides move to the 4.3.2 / 3.15.2 lines that
GHSA-2883-xcg3-v3hh requires; `pnpm audit --prod` is clean apart from
the already-ignored `extract-zip` advisory.

## Behaviour notes

- `composio <unknown> --help` now prints the root help with exit 0 (v4's
global `--help` handling); `composio <unknown>` without `--help` still
fails with the unknown-subcommand error.

## Validation

- `pnpm --filter @composio/cli typecheck` (src + test): 0 errors
- `pnpm --filter @composio/cli test`: 127 files, 1325 tests pass, 1
skipped; `validate:boundaries` and `validate:skills` pass
- `@composio/cli-keyring` and `@composio/json-schema-to-effect-schema`
typecheck, test, and build pass
- `pnpm validate:agent-skills` and `pnpm validate:skill-routing` pass
(19 skills)
- oxlint clean on `ts/packages/cli`, `cli-keyring`,
`json-schema-to-effect-schema`
- CLI bundle and standalone binary build; smoke-checked `version`,
`--version`, `-v`, `--help`, unknown subcommand, unrecognized flag,
missing flag value
- Docker CLI e2e suites pass against an image built from this branch:
`version`, `toolkits-list`, `toolkits-info`, `toolkits-search`,
`setup-plugins`, `run`. `whoami` (needs an API key), `install` (needs a
release dir), and `upgrade` (needs network) were not run.

No changeset: `@composio/cli` is Changesets-ignored and the ported
sibling packages are private. Human-facing notes are in
`ts/packages/cli/CHANGELOG.md`.

https://claude.ai/code/session_01AW7ZPhfZuni6PrCJ9X86DX
2026-09-10 17:47:14 +02:00
Alberto Schiabel d4077ba415 chore(cli): trim unused Effect packages and unify version output (#4358)
This PR:

- drops the eight `@effect/*` satellite devDependencies and
`@effect/platform-node-shared` from `@composio/cli`; none is imported by
the CLI, its tests, or its scripts, and the
`@effect/platform-node-shared` catalog entry goes with them
- makes `--log-level` fall back to `COMPOSIO_LOG_LEVEL` when the flag is
absent (`Option.orElse` instead of `Option.zipLeft`, which discarded the
env value) and adds a precedence test
- rewrites `composio --version` and `composio -v` to the `version`
command before parsing, so the three spellings share one handler and
print identical output (the framework built-in used to add a trailing
blank line); CI and the installer keep using `composio --version`

## Context

First of three preparation PRs for the Effect v4 port;
https://github.com/ComposioHQ/composio/pull/3901 is the reference port.
Each lands v3-compatible groundwork that the port otherwise has to redo
on top of a large diff: the manifest, catalog, and lockfile were three
of the conflicting files in that PR, and its review had accepted Effect
v4's default `composio v<semver>` banner for `--version`. Owning the
flag in argv normalization keeps `--version` output stable across the
framework change instead.

## Validation

- `pnpm --filter @composio/cli typecheck` and oxlint clean
- `pnpm --filter @composio/cli test`: 127 files, 1318 tests pass, 1
skipped; `version`, `--version`, and `-v` are asserted byte-identical
- The Docker install e2e suite was not run locally;
`cli.install-e2e.yml` runs it on this PR
2026-09-05 00:22:11 +02:00
Alberto Schiabel 09f76b1c9f refactor(cli): eliminate raw environment access (#4134)
This PR:
- routes Composio-prefixed runtime configuration through `APP_CONFIG`
and normalizes unprefixed host values through `HOST_CONFIG` in
`app-config.ts`
- removes `loadOptionalAppConfig`-style fallback loading so optional
strings, booleans, and CLI flag precedence resolve at the configuration
boundary
- removes every executable `process.env` reference from CLI source;
child commands inherit the ambient environment through
`@effect/platform` and receive explicit normalized overrides
- preserves arbitrary `CODEX_*`, `CLAUDE_*`, and `OPENCLAW_*` detection
through Effect config enumeration without exposing the raw environment
map
- propagates telemetry debug state through worker arguments instead of
mutating the process environment
- replaces removable filesystem, OS, subprocess, and error-handling
exceptions with Effect services and typed control flow
- documents supported and internal CLI environment variables, including
their `user_data.json` and `config.json` mappings
- reduces registered CLI lint boundaries from 45 to 4; the retained
entries are the detached-spawn, Node OS, synchronous preload filesystem,
and MD5 checksum implementations
- verifies the result with 1,201 passing CLI tests (1 skipped), strict
Oxlint, boundary validation, root typechecking across 19 packages, the
CLI build, and real `composio run` child-process checks
2026-08-18 12:54:26 +02:00
jkomyno 5350b00d90 perf(cli): resolve toolkits from local knowledge, not the catalog
Every tool execution had to know which toolkit the tool belongs to, and
the only reliable source was the toolkit catalog — ~800 KB and ~2 s of
the wall time of a command that then does one small API call.

Match against what the CLI already knows instead: the slugs baked in at
build time, plus the ones this machine has learned since, kept in
`known-toolkit-slugs.json`. A slug that matches nothing known still
falls through to the catalog — that is what a toolkit released after the
binary looks like — and what it finds is remembered, so it costs a fetch
once rather than every run. Learned slugs older than a week trigger a
background refresh; that bounds how long a brand-new toolkit can be
mistaken for a shorter one sharing its prefix.

The file is derived data rather than saved API responses, so it is read
regardless of FORCE_USE_CACHE, which keeps its meaning. Nothing here can
fail a command: a missing, unreadable, or corrupt file means "nothing
learned yet", and an unreachable catalog still degrades to the
first-underscore guess.

Cache writes also move to a temp file and a rename, so an interrupted
run leaves the previous cache intact instead of a truncated file that
the next run reads back as a parse failure.
2026-08-10 17:12:58 +02:00
jkomyno 16b167c94a docs(cli): document COMPOSIO_BIN_DIR and the install abort contract
COMPOSIO_BIN_DIR was discoverable only by reading the changelog: it is
read through a raw ConfigProvider and appeared in no help text. Add it to
the README env-var table with its resolution order, and name it in the
install command description so `composio install --help` mentions it.
No --bin-dir flag: the env var is the right shape for an installer
handoff.

The changelog entry also picks up the behavior changes it was missing —
the non-zero exit on abort and what it means for install.sh's fallback,
both abort conditions, the narrowed character set, legacy-block
migration, and a note for custom-install-dir users reinstalling without
re-specifying COMPOSIO_INSTALL_DIR.
2026-08-04 19:17:14 +05:30
Kshitij Jhunjhunwala f2beb2f259 feat(cli): install agent plugins with composio setup 2026-07-13 14:14:19 -07:00
Rahul Tarak d80e109e26 Add connection removal CLI (#3259)
## Summary
- Add interactive `composio connections remove <account>` support for
consumer connections.
- Resolve the account selector by toolkit slug, alias, word_id, or
connected account ID, with ambiguity handling.
- Require explicit confirmation before deleting a connection, defaulting
to No.
- Update CLI help/README and add tests for confirmed removal, declined
removal, and ambiguous selectors.

## Testing
- `pnpm --filter @composio/cli test --
test/src/commands/connections/connections.list.cmd.test.ts`
- `pnpm typecheck`
2026-04-23 14:54:07 -07:00
Rahul Tarak 1c4b428a38 Fix install-skill flag spelling in CLI help and parser (#3223)
## Summary
- Corrects the root CLI flag spelling from `--instal-skill` to
`--install-skill` in help text, README examples, parser messages, and
tests.
- Preserves `--instal-skill` as a backward-compatible alias so existing
usage still works.
- Bumps `@composio/cli` to `0.2.24` to realign the published package
with the GitHub release tag.

## Testing
- Updated and expanded CLI parser tests for canonical flag parsing,
legacy alias handling, missing target errors, and invalid target errors.
- Not run: full package test suite.
- Not run: build / publish verification.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 03:47:00 -07:00
Rahul Tarak 20cfa6cdae feat(cli): add composio connections list command (#3206)
## Summary
- Adds `composio connections list` command that groups connected
accounts by toolkit and displays aliases
- New command file at
`ts/packages/cli/src/commands/connections/commands/connections.list.cmd.ts`
with test coverage
- Registers the command under the `connections` group and in root help

## Stacked on
This PR is stacked on #3202 (`cli/keyring-migration`).

## Test plan
- [ ] `pnpm --filter @composio/cli test` (connections.list.cmd.test.ts)
- [ ] Manual: `composio connections list` with a logged-in account shows
grouped toolkit output with aliases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 01:10:19 -07:00
Rahul Tarak 5c27c0050a Add root skill-install flag for Claude, Codex, and OpenClaw (#3137)
## Summary
- Adds a root-level `--instal-skill` / `--install-skill` flag so users
can install the composio skill without going through a subcommand.
- Supports selecting the target agent (`claude`, `codex`, or `openclaw`)
and optionally overriding the installed skill name.
- Updates the install flow to place the skill under the chosen agent’s
skills directory and report the selected target in success/warning
messages.
- Documents the new root flag in the CLI README and root help output.
- Adds coverage for flag parsing, target path resolution, and skill-name
validation.

## Testing
- `pnpm test
ts/packages/cli/test/src/commands/install-skill-root-flag.test.ts`
- `pnpm test ts/packages/cli/test/src/effects/install-skill.test.ts`
- Not run: full repository test suite
2026-04-09 22:37:54 -07:00
Rahul Tarak d1ef6b25ec Add direct user API key login to the CLI (#3132)
## Summary
- Adds a new `composio login --user-api-key` flow for direct login
without the browser/session-key path.
- Supports selecting a default organization with `--org` and validates
incompatible flag combinations.
- Updates login help, CLI docs, and command output so the direct login
path reports the selected org consistently.
- Expands login tests to cover help text and direct API key login
behavior.

## Testing
- `pnpm test -- login.cmd.test.ts` or equivalent CLI test run covering
the updated login command.
- Verified help output includes `--user-api-key` and `--org` and no
longer advertises legacy `--api-key`.
- Verified direct login stores the chosen org and writes the expected
user config values.
- Not run: full repository test suite.
2026-04-07 19:08:00 -07:00
Rahul Tarak 91a7d044de Add composio listen and top-level composio triggers CLI commands (#3115)
## Summary
- Add `composio listen` command for real-time trigger event streaming
with interactive setup flow (toolkit/trigger selection, account
connection, listener subscription).
- Add top-level `composio triggers list` and `composio triggers info`
entrypoints alongside the existing `dev` commands.
- Update root help, command hints, and README examples to advertise the
new trigger and listen commands.
- Refactor trigger list/info command construction so the `dev` and root
variants share the same implementation with different hints and
empty-state guidance.
- Extend tests to cover the new root-level trigger commands,
command-hint examples, and CI fixes.

## Test plan
- [x] CLI unit tests for `composio triggers list` and `composio triggers
info`
- [x] CLI unit tests for command-hints covering trigger examples
- [x] E2E tests updated for toolkit list/info/search
- [ ] Manual test of `composio listen` interactive flow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 00:48:00 -07:00
Rahul Tarak 59844b5809 Add beta-channel CLI release promotion flow (#3089)
## Summary
- Add support for beta CLI releases in the binary publish workflow,
including beta tag validation and promotion to stable from an existing
prerelease tag.
- Update `composio upgrade` to support a `--beta` flag that stays on the
prerelease channel.
- Refresh release documentation and CLI README to describe the new
beta/stable release model.
- Expand upgrade binary tests to cover prerelease resolution and
channel-specific behavior.

## Testing
- Not run (PR content generation only).
- Checked the workflow and CLI changes for beta/stable tag handling
paths.
- Reviewed updated release documentation for the new promotion flow.
2026-03-31 16:23:27 -07:00
Rahul Tarak 29b4287ff7 docs: improve CLI workflow guide (#3055)
## Summary
- rewrite the CLI docs page around the real top-level workflow
- explain when to use `execute`, `search`, `--get-schema`, `--dry-run`,
`link`, `run`, and `proxy`
- keep `composio dev` clearly separated from the normal end-user flow

## Testing
- `pnpm exec prettier --check docs/content/docs/cli.mdx`
2026-03-27 07:49:46 -07:00
Rahul Tarak a2ea9e8f16 fix(cli): update default dashboard url 2026-03-19 23:54:08 -07:00
Musthaq Ahamad 67867aea11 feat(cli): add --no-wait and --key flags to login command (#2906)
## Summary
Adds new flags to `composio login` for agent/auth flows:

### `--no-wait`
- Print login URL and session info (JSON) then exit without opening
browser or waiting
- Output is jq-parseable for scripting

### `--key <key>`
- Complete login using session key from `composio login --no-wait`
- **Without `--no-wait`**: Polls until session is linked (same as
browser flow after printing URL)
- **With `--no-wait`**: Checks once and fails if not linked

### Usage flow
```bash
# 1. Get login URL and session key
composio login --no-wait

# 2. Open the URL in browser and complete login

# 3. Complete login (polls until linked)
composio login --key <key>

# Or check once and fail if not linked
composio login --key <key> --no-wait
```

### Files changed
- `login.cmd.ts` - Added flags and `loginWithKey` flow
- `root-help.ts` - Updated usage
- Tests, README, AGENTS.md, snapshot

Made with [Cursor](https://cursor.com)
2026-03-13 18:17:14 +05:30
Musthaq Ahamad 4fda636aba chore(cli): migrate binary release tags and docs (#2719)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-25 16:29:04 -08:00
jkomyno 4d51efc8e8 chore(cli): rename build:bin to build:binary 2026-02-23 13:11:52 +04:00
jkomyno 317c27519d chore(ts/cli): update README 2026-01-15 01:16:53 +01:00
Alberto Schiabel 8d6f77d93b feat(cli): complete login command (#1862)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-08-22 11:29:17 +05:30
jkomyno 911969639b chore: fix conflicts 2025-07-29 08:31:09 +04:00
jkomyno 32826b2637 chore(cli): update README 2025-07-29 06:17:47 +04:00
jkomyno fe5acc7d79 feat(cli): ensure colors have proper contrast 2025-07-29 03:41:14 +04:00
Alberto Schiabel d14bfd7386 feat(cli): support upgrade command (#1774)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-07-21 17:49:57 +05:30
Rahul Tarak 1d02d3e495 merge cli (#1649)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-06-17 18:06:05 -07:00