cc-hub 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. cc_hub-0.2.1/.gitattributes +1 -0
  2. cc_hub-0.2.1/.github/workflows/ci.yml +30 -0
  3. cc_hub-0.2.1/.github/workflows/release.yml +53 -0
  4. cc_hub-0.2.1/.gitignore +9 -0
  5. cc_hub-0.2.1/CHANGELOG.md +124 -0
  6. cc_hub-0.2.1/LICENSE +21 -0
  7. cc_hub-0.2.1/PKG-INFO +86 -0
  8. cc_hub-0.2.1/README.md +69 -0
  9. cc_hub-0.2.1/README.zh-CN.md +36 -0
  10. cc_hub-0.2.1/docs/acceptance.md +23 -0
  11. cc_hub-0.2.1/docs/cc-connect.md +64 -0
  12. cc_hub-0.2.1/docs/codex-sandbox.md +33 -0
  13. cc_hub-0.2.1/docs/install.md +70 -0
  14. cc_hub-0.2.1/docs/research/2026-09-22-research-brief.md +110 -0
  15. cc_hub-0.2.1/docs/superpowers/plans/2026-09-22-cc-hub-v1.md +5745 -0
  16. cc_hub-0.2.1/docs/superpowers/specs/2026-09-22-cc-hub-design.md +581 -0
  17. cc_hub-0.2.1/docs/windows.md +29 -0
  18. cc_hub-0.2.1/pyproject.toml +46 -0
  19. cc_hub-0.2.1/src/cc_hub/__init__.py +4 -0
  20. cc_hub-0.2.1/src/cc_hub/__main__.py +7 -0
  21. cc_hub-0.2.1/src/cc_hub/cli.py +79 -0
  22. cc_hub-0.2.1/src/cc_hub/commands/__init__.py +1 -0
  23. cc_hub-0.2.1/src/cc_hub/commands/doctor.py +373 -0
  24. cc_hub-0.2.1/src/cc_hub/commands/env.py +218 -0
  25. cc_hub-0.2.1/src/cc_hub/commands/hosts.py +44 -0
  26. cc_hub-0.2.1/src/cc_hub/commands/init.py +110 -0
  27. cc_hub-0.2.1/src/cc_hub/commands/link.py +33 -0
  28. cc_hub-0.2.1/src/cc_hub/commands/memory.py +172 -0
  29. cc_hub-0.2.1/src/cc_hub/commands/projects.py +196 -0
  30. cc_hub-0.2.1/src/cc_hub/commands/update.py +203 -0
  31. cc_hub-0.2.1/src/cc_hub/console.py +34 -0
  32. cc_hub-0.2.1/src/cc_hub/encoding.py +74 -0
  33. cc_hub-0.2.1/src/cc_hub/hub.py +67 -0
  34. cc_hub-0.2.1/src/cc_hub/manifest.py +69 -0
  35. cc_hub-0.2.1/src/cc_hub/platform.py +70 -0
  36. cc_hub-0.2.1/src/cc_hub/templates/AGENTS.local.md +3 -0
  37. cc_hub-0.2.1/src/cc_hub/templates/AGENTS.md +80 -0
  38. cc_hub-0.2.1/src/cc_hub/templates/BOOTSTRAP.md +31 -0
  39. cc_hub-0.2.1/src/cc_hub/templates/IDENTITY.md +3 -0
  40. cc_hub-0.2.1/src/cc_hub/templates/MEMORY.md +12 -0
  41. cc_hub-0.2.1/src/cc_hub/templates/SOUL.md +26 -0
  42. cc_hub-0.2.1/src/cc_hub/templates/USER.md +9 -0
  43. cc_hub-0.2.1/src/cc_hub/templates/_gitignore +16 -0
  44. cc_hub-0.2.1/src/cc_hub/templates/cron/README.md +19 -0
  45. cc_hub-0.2.1/src/cc_hub/templates/cron/memory-consolidate.md +7 -0
  46. cc_hub-0.2.1/src/cc_hub/templates/hosts.toml +9 -0
  47. cc_hub-0.2.1/src/cc_hub/templates/hub.toml +11 -0
  48. cc_hub-0.2.1/src/cc_hub/templates/projects.toml +8 -0
  49. cc_hub-0.2.1/src/cc_hub/templates/skills/hub-adapt/SKILL.md +42 -0
  50. cc_hub-0.2.1/src/cc_hub/templates/skills/hub-cc-connect/SKILL.md +51 -0
  51. cc_hub-0.2.1/src/cc_hub/templates/skills/hub-hosts/SKILL.md +48 -0
  52. cc_hub-0.2.1/src/cc_hub/templates/skills/hub-memory/SKILL.md +43 -0
  53. cc_hub-0.2.1/src/cc_hub/templates/skills/hub-projects/SKILL.md +34 -0
  54. cc_hub-0.2.1/tests/__init__.py +1 -0
  55. cc_hub-0.2.1/tests/conftest.py +13 -0
  56. cc_hub-0.2.1/tests/integration/__init__.py +1 -0
  57. cc_hub-0.2.1/tests/integration/test_doctor.py +196 -0
  58. cc_hub-0.2.1/tests/integration/test_env.py +82 -0
  59. cc_hub-0.2.1/tests/integration/test_hosts_cli.py +37 -0
  60. cc_hub-0.2.1/tests/integration/test_init.py +88 -0
  61. cc_hub-0.2.1/tests/integration/test_link.py +62 -0
  62. cc_hub-0.2.1/tests/integration/test_update.py +171 -0
  63. cc_hub-0.2.1/tests/unit/__init__.py +1 -0
  64. cc_hub-0.2.1/tests/unit/test_cli.py +33 -0
  65. cc_hub-0.2.1/tests/unit/test_docs.py +59 -0
  66. cc_hub-0.2.1/tests/unit/test_encoding.py +80 -0
  67. cc_hub-0.2.1/tests/unit/test_hub.py +68 -0
  68. cc_hub-0.2.1/tests/unit/test_manifest.py +149 -0
  69. cc_hub-0.2.1/tests/unit/test_memory.py +94 -0
  70. cc_hub-0.2.1/tests/unit/test_platform.py +14 -0
  71. cc_hub-0.2.1/tests/unit/test_projects.py +137 -0
  72. cc_hub-0.2.1/uv.lock +372 -0
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,30 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, macos-latest, windows-latest]
14
+ python: ["3.11", "3.12"]
15
+ runs-on: ${{ matrix.os }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: astral-sh/setup-uv@v5
19
+ with:
20
+ python-version: ${{ matrix.python }}
21
+ - run: uv sync --group dev
22
+ - run: uv run ruff check .
23
+ - run: uv run pytest -q
24
+ - run: uv build
25
+ - name: smoke test the wheel
26
+ shell: bash
27
+ run: |
28
+ uvx --from dist/*.whl cc-hub version
29
+ uvx --from dist/*.whl cc-hub init "${RUNNER_TEMP}/hub" --no-git
30
+ uvx --from dist/*.whl cc-hub --hub "${RUNNER_TEMP}/hub" doctor --json
@@ -0,0 +1,53 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: astral-sh/setup-uv@v5
13
+ - run: uv sync --group dev
14
+ - run: uv run pytest -q
15
+ - run: uv build
16
+ - uses: actions/upload-artifact@v4
17
+ with:
18
+ name: dist
19
+ path: dist/*
20
+
21
+ github-release:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ contents: write
26
+ steps:
27
+ - uses: actions/download-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist
31
+ - name: GitHub release
32
+ uses: softprops/action-gh-release@v2
33
+ with:
34
+ files: dist/*
35
+ generate_release_notes: true
36
+
37
+ publish-pypi:
38
+ # Opt-in: set the repository variable PUBLISH_PYPI to "true" once a PyPI
39
+ # trusted publisher exists. Independent of the GitHub release, so a PyPI
40
+ # outage must not block the release assets.
41
+ if: vars.PUBLISH_PYPI == 'true'
42
+ needs: build
43
+ runs-on: ubuntu-latest
44
+ continue-on-error: true
45
+ permissions:
46
+ id-token: write
47
+ steps:
48
+ - uses: actions/download-artifact@v4
49
+ with:
50
+ name: dist
51
+ path: dist
52
+ - name: publish to PyPI (trusted publishing)
53
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ .superpowers/
2
+ .venv/
3
+ dist/
4
+ build/
5
+ __pycache__/
6
+ *.pyc
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ *.egg-info/
@@ -0,0 +1,124 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1 - 2026-09-30
4
+
5
+ Template fixes; no command changes. The cron guidance is now checked against
6
+ the cc-connect 1.5.0 source. First release published on PyPI:
7
+ `uv tool install cc-hub`.
8
+
9
+ ### Fixed
10
+
11
+ - Cron tasks now get the session mode they declare. `BOOTSTRAP.md`,
12
+ `cron/README.md` and `hub-cc-connect` register a task with
13
+ `--session-mode <session> --desc "hub:<name>"`, where `<name>` is the file
14
+ name without `.md`. Bootstrap checks `cc-connect cron list` first and skips
15
+ tasks that are already registered. Before this, the `session` field was
16
+ never passed on, so `memory-consolidate` ran inside the reused chat session.
17
+ - `hub-cc-connect` lists and edits schedules with `cc-connect cron list`,
18
+ `cron edit` and `cron del`. It only deletes a schedule when the user asks.
19
+ It also says a task belongs to the chat it was registered from.
20
+ - `hub-projects` no longer points at "hub-adapt goal 4", which 0.2.0 removed.
21
+ After `projects add` under Codex, the agent tells the user to add the path
22
+ to `writable_roots` (`docs/codex-sandbox.md`) and leaves the sandbox alone.
23
+ - `AGENTS.md` refers to `hub-cc-connect` for scheduling instead of repeating
24
+ an incomplete command.
25
+
26
+ ### Migration notes
27
+
28
+ - Run `cc-hub update` to get the fixed `AGENTS.md`, `BOOTSTRAP.md`,
29
+ `cron/README.md` and skills.
30
+ - A hub bootstrapped with 0.1.0 or 0.2.0 registered `memory-consolidate`
31
+ without a session mode or description. Ask the agent to fix it, or do it
32
+ yourself: find the task's id with `cc-connect cron list` (it shows the start
33
+ of the prompt), then run
34
+ `cc-connect cron edit <id> session_mode new_per_run` and
35
+ `cc-connect cron edit <id> description hub:memory-consolidate`.
36
+
37
+ ## 0.2.0 - 2026-09-29
38
+
39
+ The hub is a convention and a router. Permissions and background work belong
40
+ to cc-connect and the agent runtime, so the hub no longer duplicates them.
41
+
42
+ ### Removed
43
+
44
+ - `cc-hub hook` (pre-tool-use blocklist, post-tool-use audit log, `snippet`,
45
+ `test`) and the `[hooks]` table in `hub.toml`. Approvals stay with
46
+ cc-connect's `mode`, and permissions with the agent runtime's own settings.
47
+ A live test on native Windows also showed the hook failing open under both
48
+ Claude Code and Codex.
49
+ - `cc-hub jobs` and the `hub-jobs` skill. Long-running work uses the agent
50
+ runtime's own background facilities, which cc-connect ends together with
51
+ the chat session (`/new`, `/switch`, idle timeout, daemon restart).
52
+ - `doctor` checks `jobs-lost` and the hook part of `pointers`.
53
+ - `cc-hub hosts check|run|push|pull`. `hosts.toml` and `hosts list` remain the
54
+ registry; the agent connects with `ssh` and `scp` itself (`hub-hosts`).
55
+ - `cc-hub memory stats`; `doctor` already reports the memory budgets.
56
+ - `doctor` check `daemon-path` and the daemon-visibility note in `ENV.md`: the
57
+ PATH cc-connect gives the agent is cc-connect's configuration.
58
+ - The permissions goal of `hub-adapt` (deny reads, Codex `writable_roots`).
59
+ Permissions and sandbox settings are left to the user and the runtime; see
60
+ `docs/codex-sandbox.md` for making projects writable under Codex.
61
+
62
+ ### Added
63
+
64
+ - `doctor` check `stale-hooks`: warns when a hook configuration in the hub
65
+ still calls `cc-hub hook`.
66
+ - `update` backs up and removes framework files that are no longer shipped
67
+ (`skills/hub-jobs/SKILL.md`).
68
+ - `projects list --json` and `projects show --json` include `resolved`, the
69
+ absolute path; stored paths stay portable (`~/...`).
70
+
71
+ ### Fixed
72
+
73
+ - `doctor` `pointers` judges only runtimes set up in this hub, so an installed
74
+ but unused agent is no longer a warning. `CLAUDE.md` is optional, as
75
+ `hub-adapt` says; one without `@AGENTS.md` is reported because it hides
76
+ `AGENTS.md`.
77
+ - `where` prints the package location even when no hub is found (exit 1).
78
+ - `memory search` ignores HTML comments, such as template notes.
79
+ - `update` edits `hub.toml` in place and keeps your comments and layout.
80
+ - `projects list` and `projects show` print absolute paths instead of `~/...`.
81
+ - Install docs no longer point at PyPI, where cc-hub is not published yet, and
82
+ warn against installing from a shell inside the Claude desktop app on
83
+ Windows. The release workflow publishes to PyPI only when the repository
84
+ variable `PUBLISH_PYPI` is `true`.
85
+
86
+ ### Migration notes
87
+
88
+ - Run `cc-hub update`. It removes `skills/hub-jobs/SKILL.md`; the backup is in
89
+ `.cc-hub/backups/<old version>/`.
90
+ - Remove the `cc-hub hook ...` entries from `.claude/settings.json` and
91
+ `.codex/hooks.json`, or ask the agent to run the `hub-adapt` skill;
92
+ `cc-hub doctor` lists leftovers as `stale-hooks`. Until then every tool call
93
+ runs a command that no longer exists, and on Linux and macOS Claude Code
94
+ treats its exit status as a block.
95
+ - The `jobs/` and `logs/` directories and the `[hooks]` table in `hub.toml`
96
+ are no longer used and can be deleted.
97
+
98
+ ## 0.1.0 - 2026-09-23
99
+
100
+ ### Added
101
+
102
+ - `cc-hub init`, `doctor`, `update`: seed, check and upgrade a hub directory.
103
+ - `cc-hub env`: machine probe written to `ENV.md` / `env.json`.
104
+ - `cc-hub memory`: daily logs, search, recent, stats.
105
+ - `cc-hub projects`: registry of local project directories.
106
+ - `cc-hub jobs`: detached background jobs with a supervising runner.
107
+ - `cc-hub hosts`: ssh/scp with base64-wrapped remote commands.
108
+ - `cc-hub hook`: pre-tool-use blocklist, post-tool-use audit log, snippet.
109
+ - Blocklist rule `find-delete` for recursive deletes of root or home via `find`.
110
+ - `cc-hub link`: symlink / junction / copy.
111
+ - Hub templates: `AGENTS.md`, `BOOTSTRAP.md`, persona files, six `hub-*` skills,
112
+ `cron/memory-consolidate.md`.
113
+
114
+ ### Known limitations
115
+
116
+ - The Codex hook payload shape is inferred from the documentation, not verified
117
+ against a real Codex run; the fixtures in `tests/fixtures` encode that guess.
118
+ - The native-Windows code paths (junctions, `taskkill`, `.cmd` shims) are
119
+ reasoned about rather than CI-executed: CI runs the suite on windows-latest,
120
+ but the jobs and kill paths are not exercised there.
121
+
122
+ ### Migration notes
123
+
124
+ First release; nothing to migrate.
cc_hub-0.2.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jenwein
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
cc_hub-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.5
2
+ Name: cc-hub
3
+ Version: 0.2.1
4
+ Summary: A hub directory convention and CLI for coding agents launched by cc-connect
5
+ Project-URL: Homepage, https://github.com/Jenwein/cc-hub
6
+ Author: Jenwein
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: agent,cc-connect,claude-code,codex,workspace
10
+ Requires-Python: >=3.11
11
+ Requires-Dist: charset-normalizer>=3
12
+ Requires-Dist: psutil>=5.9
13
+ Requires-Dist: rich>=13
14
+ Requires-Dist: tomli-w>=1.0
15
+ Requires-Dist: typer>=0.12
16
+ Description-Content-Type: text/markdown
17
+
18
+ # cc-hub
19
+
20
+ A hub directory convention and CLI for coding agents launched by
21
+ [cc-connect](https://github.com/chenhg5/cc-connect).
22
+
23
+ cc-connect bridges Claude Code, Codex and other agents to chat platforms and
24
+ starts the agent in a `work_dir`. cc-hub turns that directory into a **hub**:
25
+ the agent's home base on your machine, with a persona, memory, and a registry
26
+ of your projects and remote hosts. Permissions and background work stay with
27
+ cc-connect and the agent runtime; the hub adds conventions and routing, not
28
+ another layer of either.
29
+
30
+ The hub is agent-agnostic. It ships no Claude- or Codex-specific files; on
31
+ first run the agent creates the pointers its own ecosystem needs (`hub-adapt`).
32
+
33
+ ## Quick start
34
+
35
+ uv tool install cc-hub
36
+ cc-hub init # creates ~/.cc-hub
37
+ cc-hub doctor
38
+
39
+ Install from a regular terminal; on Windows not from a shell inside the
40
+ Claude desktop app (see [docs/install.md](docs/install.md)).
41
+
42
+ Point cc-connect at the hub (`work_dir = "/home/you/.cc-hub"`, see
43
+ [docs/cc-connect.md](docs/cc-connect.md)) and send the first message. The agent
44
+ follows `BOOTSTRAP.md`: names itself, learns who you are, registers projects,
45
+ adapts to its runtime, and deletes the bootstrap file.
46
+
47
+ ## Commands
48
+
49
+ | Command | Purpose |
50
+ |---|---|
51
+ | `cc-hub init [dir]` | Seed a hub. Existing files are never overwritten. |
52
+ | `cc-hub doctor [--fix] [--json]` | Health checks: budgets, pointers, leftover hooks. |
53
+ | `cc-hub update [--dry-run]` | Refresh framework-owned files; user files untouched; backups kept. |
54
+ | `cc-hub env` | Probe the machine and write `ENV.md` / `env.json`. |
55
+ | `cc-hub memory log\|search\|recent` | Daily logs and long-term memory. |
56
+ | `cc-hub projects list\|show\|add\|remove` | Registry of local project directories. |
57
+ | `cc-hub hosts list` | Registry of remote machines; the agent connects with ssh itself. |
58
+ | `cc-hub link <src> <dst>` | Symlink, junction or copy (platform decides). |
59
+
60
+ ## Hub layout
61
+
62
+ ~/.cc-hub/
63
+ ├── AGENTS.md AGENTS.local.md BOOTSTRAP.md instructions
64
+ ├── SOUL.md IDENTITY.md USER.md persona and user
65
+ ├── MEMORY.md memory/YYYY-MM-DD.md memory
66
+ ├── projects.toml hosts.toml hub.toml registries and config
67
+ ├── skills/ cron/ scripts/ secrets/ skills, scheduled prompts, your scripts, credentials
68
+ └── ENV.md env.json generated state (gitignored)
69
+
70
+ Framework-owned files (`AGENTS.md`, `BOOTSTRAP.md`, `skills/hub-*`, `cron/README.md`)
71
+ are replaced by `cc-hub update`. Everything else is yours.
72
+
73
+ ## Documentation
74
+
75
+ - [Install and upgrade](docs/install.md)
76
+ - [cc-connect configuration](docs/cc-connect.md)
77
+ - [Windows notes](docs/windows.md)
78
+ - [Codex sandbox notes](docs/codex-sandbox.md)
79
+ - [Manual acceptance checklist](docs/acceptance.md)
80
+ - [Design spec](docs/superpowers/specs/2026-09-22-cc-hub-design.md)
81
+
82
+ 中文说明见 [README.zh-CN.md](README.zh-CN.md)。
83
+
84
+ ## License
85
+
86
+ MIT
cc_hub-0.2.1/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # cc-hub
2
+
3
+ A hub directory convention and CLI for coding agents launched by
4
+ [cc-connect](https://github.com/chenhg5/cc-connect).
5
+
6
+ cc-connect bridges Claude Code, Codex and other agents to chat platforms and
7
+ starts the agent in a `work_dir`. cc-hub turns that directory into a **hub**:
8
+ the agent's home base on your machine, with a persona, memory, and a registry
9
+ of your projects and remote hosts. Permissions and background work stay with
10
+ cc-connect and the agent runtime; the hub adds conventions and routing, not
11
+ another layer of either.
12
+
13
+ The hub is agent-agnostic. It ships no Claude- or Codex-specific files; on
14
+ first run the agent creates the pointers its own ecosystem needs (`hub-adapt`).
15
+
16
+ ## Quick start
17
+
18
+ uv tool install cc-hub
19
+ cc-hub init # creates ~/.cc-hub
20
+ cc-hub doctor
21
+
22
+ Install from a regular terminal; on Windows not from a shell inside the
23
+ Claude desktop app (see [docs/install.md](docs/install.md)).
24
+
25
+ Point cc-connect at the hub (`work_dir = "/home/you/.cc-hub"`, see
26
+ [docs/cc-connect.md](docs/cc-connect.md)) and send the first message. The agent
27
+ follows `BOOTSTRAP.md`: names itself, learns who you are, registers projects,
28
+ adapts to its runtime, and deletes the bootstrap file.
29
+
30
+ ## Commands
31
+
32
+ | Command | Purpose |
33
+ |---|---|
34
+ | `cc-hub init [dir]` | Seed a hub. Existing files are never overwritten. |
35
+ | `cc-hub doctor [--fix] [--json]` | Health checks: budgets, pointers, leftover hooks. |
36
+ | `cc-hub update [--dry-run]` | Refresh framework-owned files; user files untouched; backups kept. |
37
+ | `cc-hub env` | Probe the machine and write `ENV.md` / `env.json`. |
38
+ | `cc-hub memory log\|search\|recent` | Daily logs and long-term memory. |
39
+ | `cc-hub projects list\|show\|add\|remove` | Registry of local project directories. |
40
+ | `cc-hub hosts list` | Registry of remote machines; the agent connects with ssh itself. |
41
+ | `cc-hub link <src> <dst>` | Symlink, junction or copy (platform decides). |
42
+
43
+ ## Hub layout
44
+
45
+ ~/.cc-hub/
46
+ ├── AGENTS.md AGENTS.local.md BOOTSTRAP.md instructions
47
+ ├── SOUL.md IDENTITY.md USER.md persona and user
48
+ ├── MEMORY.md memory/YYYY-MM-DD.md memory
49
+ ├── projects.toml hosts.toml hub.toml registries and config
50
+ ├── skills/ cron/ scripts/ secrets/ skills, scheduled prompts, your scripts, credentials
51
+ └── ENV.md env.json generated state (gitignored)
52
+
53
+ Framework-owned files (`AGENTS.md`, `BOOTSTRAP.md`, `skills/hub-*`, `cron/README.md`)
54
+ are replaced by `cc-hub update`. Everything else is yours.
55
+
56
+ ## Documentation
57
+
58
+ - [Install and upgrade](docs/install.md)
59
+ - [cc-connect configuration](docs/cc-connect.md)
60
+ - [Windows notes](docs/windows.md)
61
+ - [Codex sandbox notes](docs/codex-sandbox.md)
62
+ - [Manual acceptance checklist](docs/acceptance.md)
63
+ - [Design spec](docs/superpowers/specs/2026-09-22-cc-hub-design.md)
64
+
65
+ 中文说明见 [README.zh-CN.md](README.zh-CN.md)。
66
+
67
+ ## License
68
+
69
+ MIT
@@ -0,0 +1,36 @@
1
+ # cc-hub
2
+
3
+ 给 [cc-connect](https://github.com/chenhg5/cc-connect) 拉起的编码 agent 用的"总站":一套目录约定加一个命令行工具。
4
+
5
+ cc-connect 把 Claude Code、Codex 等 agent 接到飞书、微信、Telegram 等 IM,并在 `work_dir` 里启动 agent。cc-hub 把这个目录变成 agent 在你机器上的家:人格、记忆、项目和远程主机注册表。权限和后台任务交给 cc-connect 与 agent 运行时自己处理,总站只提供规范和路由。
6
+
7
+ 总站与 agent 无关:不带任何 Claude 或 Codex 专属文件,agent 首次运行时按自己的生态生成指针(`hub-adapt`)。
8
+
9
+ ## 快速开始
10
+
11
+ uv tool install cc-hub
12
+ cc-hub init # 创建 ~/.cc-hub
13
+ cc-hub doctor
14
+
15
+ 请在普通终端里安装;Windows 上不要在 Claude 桌面版内的 shell 里装(原因见 [docs/install.md](docs/install.md))。
16
+
17
+ 把 cc-connect 的 `work_dir` 指向总站(见 [docs/cc-connect.md](docs/cc-connect.md)),发第一条消息。agent 会按 `BOOTSTRAP.md` 起名、认识你、登记项目、适配自己的运行时,然后删除引导文件。
18
+
19
+ ## 命令
20
+
21
+ | 命令 | 用途 |
22
+ |---|---|
23
+ | `cc-hub init [dir]` | 播种总站,已有文件不覆盖 |
24
+ | `cc-hub doctor [--fix] [--json]` | 体检:预算、指针、残留钩子 |
25
+ | `cc-hub update [--dry-run]` | 只更新框架拥有的文件,用户文件不动,旧版本有备份 |
26
+ | `cc-hub env` | 探测机器,写 `ENV.md` 和 `env.json` |
27
+ | `cc-hub memory log\|search\|recent` | 日志与长期记忆 |
28
+ | `cc-hub projects list\|show\|add\|remove` | 本机项目注册表 |
29
+ | `cc-hub hosts list` | 远程主机注册表,agent 自己用 ssh 连接 |
30
+ | `cc-hub link <src> <dst>` | symlink / junction / 复制,按平台自动选 |
31
+
32
+ 其余文档见英文 README 的链接。
33
+
34
+ ## 许可证
35
+
36
+ MIT
@@ -0,0 +1,23 @@
1
+ # Manual acceptance checklist
2
+
3
+ Environment: WSL2, cc-connect running as a daemon, Claude Code as the agent,
4
+ one chat platform (Feishu or any other).
5
+
6
+ 1. Install cc-hub from a regular terminal (see `install.md`), `cc-hub init`,
7
+ `cc-hub doctor`: everything green
8
+ except `bootstrap-pending` and `env-stale`.
9
+ 2. Configure cc-connect `work_dir` and `env.PATH`, restart the daemon.
10
+ 3. Send the first message. The agent runs bootstrap: asks for a name, writes
11
+ `IDENTITY.md` and `USER.md`, runs `hub-adapt`, registers the cron task,
12
+ deletes `BOOTSTRAP.md`.
13
+ 4. `cc-hub doctor`: all green.
14
+ 5. Ask the agent to remember something. `memory/` has today's file;
15
+ `cc-hub memory search` finds it.
16
+ 6. Ask the agent to run the tests of a registered project by name. It finds
17
+ the path in `projects.toml`, runs them there, and logs the outcome.
18
+ 7. Ask the agent to run a command on a registered remote host by name. It
19
+ finds the target, port and key in `hosts.toml` and connects with ssh.
20
+ 8. Ask the agent to send a file back to the chat. It arrives.
21
+ 9. Bump the package version and run `cc-hub update`: `AGENTS.md` changes,
22
+ `SOUL.md`, `USER.md` and `memory/` do not, and `.cc-hub/backups/` holds
23
+ the previous version.
@@ -0,0 +1,64 @@
1
+ # cc-connect configuration
2
+
3
+ Minimal `[[projects]]` entry pointing a Claude Code bot at the hub:
4
+
5
+ [[projects]]
6
+ name = "hub"
7
+ admin_from = "<your user id on the platform>"
8
+
9
+ [projects.agent]
10
+ type = "claudecode"
11
+
12
+ [projects.agent.options]
13
+ work_dir = "/home/you/.cc-hub" # absolute path; ~ expansion needs cc-connect > 1.5.1
14
+ mode = "default" # approvals are relayed to the chat
15
+
16
+ [projects.agent.options.env]
17
+ PATH = "/home/you/.local/bin:/usr/local/bin:/usr/bin:/bin"
18
+ PYTHONUTF8 = "1"
19
+ CC_HUB_DIR = "/home/you/.cc-hub" # only needed when the hub is not ~/.cc-hub
20
+
21
+ [[projects.platforms]]
22
+ type = "feishu"
23
+
24
+ [projects.platforms.options]
25
+ app_id = "${FEISHU_APP_ID}"
26
+ app_secret = "${FEISHU_APP_SECRET}"
27
+ allow_from = "*"
28
+
29
+ For Codex use `type = "codex"` with the same `work_dir` and `env`, and read
30
+ [codex-sandbox.md](codex-sandbox.md).
31
+
32
+ ## PATH under a daemon
33
+
34
+ `cc-connect daemon install` runs cc-connect from systemd, launchd or the
35
+ Windows Task Scheduler. Those do not read your shell profile, so PATH is often
36
+ just the system directories and `cc-hub`, `uv`, `claude` or `codex` are not
37
+ found. Put the full PATH in `[projects.agent.options.env]` as above.
38
+ `ENV.md` lists absolute paths the agent can fall back to.
39
+
40
+ ## What the agent uses
41
+
42
+ - Attachments you send land in `<hub>/.cc-connect/attachments/<message id>/`;
43
+ cc-connect appends their absolute paths to the prompt.
44
+ - The agent sends files back with `cc-connect send --file <absolute path>`
45
+ (`--image`, `--tts`). 50 MB limit.
46
+ - Scheduled prompts: `cc-connect cron add --cron "<expr>" --prompt "<text>"
47
+ --session-mode <reuse|new_per_run> --desc "hub:<name>"`. The hub keeps
48
+ definitions in `cron/*.md`; bootstrap registers the defaults in the chat it
49
+ runs in, and skips any whose `hub:<name>` is already in `cc-connect cron list`.
50
+ - `/dir <path>` in the chat switches the working directory for the *next*
51
+ session only. Keep `work_dir` on the hub and let the agent `cd` into projects.
52
+
53
+ ## Approvals
54
+
55
+ `mode = "default"` relays every tool approval to the chat. With `/mode yolo`
56
+ or "allow all" the decision rests with the agent runtime's own permission
57
+ settings; the hub adds no enforcement of its own.
58
+
59
+ ## Sessions and background work
60
+
61
+ cc-connect keeps one agent process per chat session and ends it, together
62
+ with everything it started, on `/new`, `/switch`, a turn that stays silent
63
+ longer than `idle_timeout_mins`, or a daemon restart. Background tasks and
64
+ subagents the agent starts therefore live as long as that session.
@@ -0,0 +1,33 @@
1
+ # Codex sandbox notes
2
+
3
+ cc-connect starts Codex with `codex exec --cd <hub> --sandbox workspace-write`
4
+ by default. Inside that sandbox only the working directory (the hub) and
5
+ `writable_roots` are writable, and the restriction is inherited by every
6
+ child process the agent starts.
7
+
8
+ ## Make registered projects writable
9
+
10
+ Add their paths to `writable_roots` in `.codex/config.toml` inside the hub
11
+ (the hub is the Codex project directory, so this file applies once the hub
12
+ is trusted):
13
+
14
+ [sandbox_workspace_write]
15
+ writable_roots = ["/home/you/dev/project-a", "/home/you/dev/project-b"]
16
+
17
+ cc-hub does not change Codex's sandbox settings: add the paths yourself, and
18
+ again after each `cc-hub projects add`. If Codex rejects the key at project
19
+ level, put the same table in `~/.codex/config.toml` instead.
20
+
21
+ Alternative: pass `--add-dir <path>` through cc-connect's agent options for
22
+ each project.
23
+
24
+ ## One-time trust
25
+
26
+ Run `codex` interactively once in the hub and mark the directory trusted.
27
+ Without trust Codex ignores `.codex/config.toml`, so `writable_roots` would
28
+ not apply.
29
+
30
+ ## Full access
31
+
32
+ `--dangerously-bypass-approvals-and-sandbox` (cc-connect `mode = "yolo"`)
33
+ removes the sandbox entirely; `writable_roots` no longer matters.
@@ -0,0 +1,70 @@
1
+ # Install and upgrade
2
+
3
+ ## Requirements
4
+
5
+ - [uv](https://docs.astral.sh/uv/) (single binary; installs Python 3.11+ itself if needed)
6
+ - OpenSSH client if you use `cc-hub hosts`
7
+ - git (optional; `cc-hub init` initializes a repository in the hub)
8
+
9
+ ## Install
10
+
11
+ From PyPI (0.2.1 and later):
12
+
13
+ uv tool install cc-hub
14
+ cc-hub version
15
+
16
+ Or a released tag straight from GitHub:
17
+
18
+ uv tool install git+https://github.com/Jenwein/cc-hub.git@v0.2.1
19
+
20
+ Or download the wheel attached to the GitHub release and install that file:
21
+
22
+ uv tool install ./cc_hub-0.2.1-py3-none-any.whl
23
+
24
+ `uv tool install` puts `cc-hub` in `~/.local/bin` (Windows: `%USERPROFILE%\.local\bin`).
25
+ Make sure that directory is on your PATH; `uv tool update-shell` can add it.
26
+
27
+ **Install from a regular terminal** (Windows Terminal, PowerShell, a Linux or
28
+ macOS shell). On Windows, a shell running inside the Claude desktop app is part
29
+ of a packaged (MSIX) app: new folders it creates under `%APPDATA%` go to the
30
+ app's private storage, so a cc-hub installed there is invisible to cc-connect
31
+ and to the agents it starts. The symptom is `uv trampoline failed to
32
+ canonicalize script path`; reinstall from a regular terminal.
33
+
34
+ ## Create the hub
35
+
36
+ cc-hub init # ~/.cc-hub
37
+ cc-hub init ~/my-hub # anywhere else
38
+
39
+ The hub must not live inside another git repository, and it must not be the
40
+ root of one either; `init` refuses both. If the hub is not `~/.cc-hub`, set
41
+ `CC_HUB_DIR` to its absolute path in cc-connect's
42
+ `[projects.agent.options.env]` so every `cc-hub` call finds it from any
43
+ working directory.
44
+ Treat the hub as private data: commit it to a private repository if you want
45
+ backups. `secrets/`, generated files and agent pointers are already gitignored.
46
+
47
+ ## Connect cc-connect
48
+
49
+ See [cc-connect.md](cc-connect.md). Then send the agent its first message.
50
+
51
+ ## Check
52
+
53
+ cc-hub doctor
54
+
55
+ Warnings about `bootstrap-pending` and `env-stale` disappear after the first
56
+ conversation. When cc-connect runs as a service, make sure it can find
57
+ `cc-hub` and `uv`; see the PATH notes in [cc-connect.md](cc-connect.md).
58
+
59
+ ## Upgrade
60
+
61
+ uv tool upgrade cc-hub # installed from PyPI
62
+ uv tool install --force git+https://github.com/Jenwein/cc-hub.git@<new tag> # from GitHub
63
+ cc-hub update --dry-run # see what would change
64
+ cc-hub update
65
+
66
+ `update` replaces only framework-owned files (`AGENTS.md`, `BOOTSTRAP.md`,
67
+ `skills/hub-*`, `cron/README.md`, `cron/memory-consolidate.md`, `.gitignore`)
68
+ and merges new keys into `hub.toml`. Previous versions are copied to
69
+ `.cc-hub/backups/<old version>/`. Read the migration notes in `CHANGELOG.md`
70
+ before upgrading across minor versions.