Skip to content

refactor(cli): move cache under import command#71

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
m0Nst3r873:main
Jun 30, 2026
Merged

refactor(cli): move cache under import command#71
jeff-r2026 merged 2 commits into
Tencent:mainfrom
m0Nst3r873:main

Conversation

@m0Nst3r873

@m0Nst3r873 m0Nst3r873 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Simplify the CLI command surface for better discoverability:

1. Move cache under import

Cache only serves import's shallow clone repos. Remove the standalone top-level command; functionality now accessible as import options.

Before:

teamai cache --status
teamai cache --gc

After:

teamai import --cache-status
teamai import --cache-gc

2. Hide internal codebase options

teamai codebase had 5 options that are either redundant with import --from-repo or one-time migration utilities. Hide them from --help (still functional for advanced users):

  • --extract — redundant with teamai import --from-repo .
  • --incremental, --project, --max-files — extract sub-options
  • --upgrade-wiki — one-time migration tool, no longer needed after migration

teamai codebase --help now shows only its core purpose:

Options:
  --lint      Run global consistency lint over docs/team-codebase
  --fix       Apply low-risk mechanical fixes (only with --lint)
  --json      Output report as JSON (suitable for CI)

Test plan

  • npx tsc --noEmit — zero errors
  • npx vitest run — 1587 passed
  • teamai import --help shows --cache-status and --cache-gc
  • teamai --help no longer shows cache
  • teamai codebase --help only shows --lint / --fix / --json
  • Hidden options still functional when explicitly passed

jaelgeng added 2 commits June 30, 2026 14:26
…e-gc)

Cache only serves import's shallow clone repos. Move it under the
import command for better discoverability:

  teamai import --cache-status   # show cache disk usage
  teamai import --cache-gc       # garbage-collect stale entries

The old `teamai cache` command is preserved as a hidden alias for
backward compatibility.
…ternal options

- Remove top-level `teamai cache` command; functionality now accessible
  via `teamai import --cache-status` / `--cache-gc`
- Hide low-frequency codebase options from --help:
  --extract, --incremental, --project, --max-files, --upgrade-wiki
  (still functional, just not shown to avoid noise)
- `teamai codebase` now shows only its core: --lint / --fix / --json
@jeff-r2026 jeff-r2026 merged commit 10c5aba into Tencent:main Jun 30, 2026
7 checks passed
jeff-r2026 added a commit that referenced this pull request Jun 30, 2026
Post-merge quality cleanups on the HTTP team-repo + status-reporter
code (PRs #68/#70/#71), surfaced by /simplify. No behavior change.

- path-safety: extract assertWithinRoot() and replace the hand-rolled
  containment check duplicated in source-http.ts and skill-command.ts.
  It compares resolved-but-not-symlink-followed paths, so it stays
  correct for not-yet-created targets and under symlinked roots
  (e.g. macOS /var -> /private/var) — unlike assertSafePath, which
  would false-reject legitimate writes there.
- status-report: drop the no-op `await import('fs-extra')` in flushQueue
  (fs-extra is already loaded via utils/fs) and use the project
  remove/writeFile helpers; parallelize scanReportableSkills with
  Promise.all instead of awaiting per-skill reads in a loop.
- team-push: reuse readJson/writeJson for the reported-interventions
  snapshot instead of hand-rolled JSON.parse/stringify.

Verified: `tsc --noEmit` clean; full unit suite green (1662 passed).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants