Skip to content

Commit 9dc72c0

Browse files
tdiclaude
andcommitted
Initial commit: ccagents - Claude Code agent manager
- Core functionality for managing Claude Code agents via symlinks - Support for local and GitHub single-file agent sources - Commands: add, list, enable, disable, sync, clean, doctor, import - Portable configuration using relative paths in .agents.json - Comprehensive error handling and edge case management - Beautiful CLI with colored output and status indicators - Full test suite with 71+ tests - GitHub Actions workflows for CI/CD and releases - Documentation: README, CHANGELOG, and project instructions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
0 parents  commit 9dc72c0

29 files changed

+5797
-0
lines changed

.github/workflows/ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
rust: [stable, beta]
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
components: rustfmt, clippy
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v3
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
35+
- name: Cache cargo index
36+
uses: actions/cache@v3
37+
with:
38+
path: ~/.cargo/git
39+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Cache cargo build
42+
uses: actions/cache@v3
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
46+
47+
- name: Check formatting
48+
run: cargo fmt -- --check
49+
continue-on-error: ${{ matrix.rust == 'beta' }}
50+
51+
- name: Run clippy
52+
run: cargo clippy -- -D warnings
53+
continue-on-error: ${{ matrix.rust == 'beta' }}
54+
55+
- name: Build
56+
run: cargo build --verbose
57+
58+
- name: Run tests
59+
run: cargo test --verbose
60+
61+
- name: Build release
62+
run: cargo build --release --verbose
63+
64+
coverage:
65+
name: Code Coverage
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Install Rust
71+
uses: dtolnay/rust-toolchain@stable
72+
73+
- name: Install tarpaulin
74+
run: cargo install cargo-tarpaulin
75+
76+
- name: Generate coverage
77+
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
78+
79+
- name: Upload coverage to Codecov
80+
uses: codecov/codecov-action@v3
81+
with:
82+
file: ./cobertura.xml
83+
fail_ci_if_error: false
84+
85+
check-version:
86+
name: Check Version
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: Install Rust
92+
uses: dtolnay/rust-toolchain@stable
93+
94+
- name: Check version command
95+
run: |
96+
cargo build --release
97+
./target/release/ccagents version
98+
./target/release/ccagents --version

.github/workflows/release.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build Release
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
include:
18+
- os: ubuntu-latest
19+
target: x86_64-unknown-linux-gnu
20+
binary_name: ccagents
21+
asset_name: ccagents-linux-amd64
22+
23+
- os: ubuntu-latest
24+
target: x86_64-unknown-linux-musl
25+
binary_name: ccagents
26+
asset_name: ccagents-linux-musl-amd64
27+
28+
- os: ubuntu-latest
29+
target: aarch64-unknown-linux-gnu
30+
binary_name: ccagents
31+
asset_name: ccagents-linux-arm64
32+
33+
- os: windows-latest
34+
target: x86_64-pc-windows-msvc
35+
binary_name: ccagents.exe
36+
asset_name: ccagents-windows-amd64
37+
38+
- os: macos-latest
39+
target: x86_64-apple-darwin
40+
binary_name: ccagents
41+
asset_name: ccagents-macos-amd64
42+
43+
- os: macos-latest
44+
target: aarch64-apple-darwin
45+
binary_name: ccagents
46+
asset_name: ccagents-macos-arm64
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Install Rust
52+
uses: dtolnay/rust-toolchain@stable
53+
with:
54+
targets: ${{ matrix.target }}
55+
56+
- name: Install cross-compilation tools
57+
if: matrix.target == 'aarch64-unknown-linux-gnu'
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y gcc-aarch64-linux-gnu
61+
62+
- name: Install musl tools
63+
if: matrix.target == 'x86_64-unknown-linux-musl'
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get install -y musl-tools
67+
68+
- name: Build
69+
run: cargo build --release --target ${{ matrix.target }}
70+
71+
- name: Strip binary (Linux/macOS)
72+
if: matrix.os != 'windows-latest'
73+
run: |
74+
strip target/${{ matrix.target }}/release/${{ matrix.binary_name }}
75+
76+
- name: Create archive (Linux/macOS)
77+
if: matrix.os != 'windows-latest'
78+
run: |
79+
cd target/${{ matrix.target }}/release
80+
tar czf ../../../${{ matrix.asset_name }}.tar.gz ${{ matrix.binary_name }}
81+
cd ../../../
82+
sha256sum ${{ matrix.asset_name }}.tar.gz > ${{ matrix.asset_name }}.tar.gz.sha256
83+
84+
- name: Create archive (Windows)
85+
if: matrix.os == 'windows-latest'
86+
shell: powershell
87+
run: |
88+
cd target/${{ matrix.target }}/release
89+
Compress-Archive -Path ${{ matrix.binary_name }} -DestinationPath ../../../${{ matrix.asset_name }}.zip
90+
cd ../../../
91+
Get-FileHash ${{ matrix.asset_name }}.zip -Algorithm SHA256 | Out-File -FilePath ${{ matrix.asset_name }}.zip.sha256
92+
93+
- name: Upload artifacts
94+
uses: actions/upload-artifact@v3
95+
with:
96+
name: binaries
97+
path: |
98+
*.tar.gz
99+
*.tar.gz.sha256
100+
*.zip
101+
*.zip.sha256
102+
103+
release:
104+
name: Create Release
105+
needs: build
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Download artifacts
111+
uses: actions/download-artifact@v3
112+
with:
113+
name: binaries
114+
path: ./artifacts
115+
116+
- name: Extract version
117+
id: get_version
118+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
119+
120+
- name: Read changelog
121+
id: changelog
122+
run: |
123+
VERSION="${{ steps.get_version.outputs.VERSION }}"
124+
CHANGELOG=$(sed -n "/## $VERSION/,/## v[0-9]/p" CHANGELOG.md | sed '$d' || echo "See CHANGELOG.md for details")
125+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
126+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
127+
echo "EOF" >> $GITHUB_OUTPUT
128+
129+
- name: Create Release
130+
uses: softprops/action-gh-release@v1
131+
with:
132+
name: ${{ steps.get_version.outputs.VERSION }}
133+
body: |
134+
## Changes
135+
${{ steps.changelog.outputs.CHANGELOG }}
136+
137+
## Installation
138+
139+
### From binary
140+
Download the appropriate binary for your platform from the assets below.
141+
142+
### From source
143+
```bash
144+
cargo install ccagents
145+
```
146+
147+
## Checksums
148+
SHA256 checksums are provided for all binaries.
149+
files: |
150+
artifacts/*
151+
draft: false
152+
prerelease: ${{ contains(steps.get_version.outputs.VERSION, '-') }}
153+
154+
publish-crate:
155+
name: Publish to crates.io
156+
needs: release
157+
runs-on: ubuntu-latest
158+
steps:
159+
- uses: actions/checkout@v4
160+
161+
- name: Install Rust
162+
uses: dtolnay/rust-toolchain@stable
163+
164+
- name: Publish to crates.io
165+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
166+
continue-on-error: true

.gitignore

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
4+
target/
5+
6+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8+
# Cargo.lock
9+
10+
# These are backup files generated by rustfmt
11+
**/*.rs.bk
12+
13+
# MSVC Windows builds of rustc generate these, which store debugging information
14+
*.pdb
15+
16+
# RustRover
17+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
18+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
19+
# and can be added to the global gitignore or merged into this file. For a more nuclear
20+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21+
.idea/
22+
23+
# VS Code
24+
.vscode/
25+
*.code-workspace
26+
27+
# macOS
28+
.DS_Store
29+
.AppleDouble
30+
.LSOverride
31+
32+
# Windows
33+
Thumbs.db
34+
ehthumbs.db
35+
Desktop.ini
36+
$RECYCLE.BIN/
37+
*.cab
38+
*.msi
39+
*.msm
40+
*.msp
41+
*.lnk
42+
43+
# Linux
44+
*~
45+
.fuse_hidden*
46+
.directory
47+
.Trash-*
48+
.nfs*
49+
50+
# Vim
51+
[._]*.s[a-v][a-z]
52+
[._]*.sw[a-p]
53+
[._]s[a-rt-v][a-z]
54+
[._]ss[a-gi-z]
55+
[._]sw[a-p]
56+
Session.vim
57+
Sessionx.vim
58+
.netrwhist
59+
tags
60+
[._]*.un~
61+
62+
# Emacs
63+
*~
64+
\#*\#
65+
/.emacs.desktop
66+
/.emacs.desktop.lock
67+
*.elc
68+
auto-save-list
69+
tramp
70+
.\#*
71+
.org-id-locations
72+
*_archive
73+
*_flymake.*
74+
/eshell/history
75+
/eshell/lastdir
76+
/elpa/
77+
*.rel
78+
/auto/
79+
.cask/
80+
dist/
81+
flycheck_*.el
82+
/server/
83+
.projectile
84+
.dir-locals.el
85+
/network-security.data
86+
87+
# Project specific
88+
.agents.json
89+
.ccagents/
90+
.claude/
91+
92+
# Test artifacts
93+
tarpaulin-report.html
94+
cobertura.xml
95+
*.profraw
96+
*.profdata
97+
98+
# Build artifacts
99+
*.o
100+
*.so
101+
*.dylib
102+
*.dll
103+
*.exe
104+
*.out
105+
*.app
106+
107+
# Documentation
108+
/target/doc/
109+
110+
# Temporary files
111+
*.tmp
112+
*.temp
113+
*.log
114+
*.pid
115+
*.seed
116+
*.pid.lock
117+
118+
# Environment files
119+
.env
120+
.env.local
121+
.env.*.local
122+
123+
# Rust analyzer
124+
/rust-project.json

0 commit comments

Comments
 (0)