claudepod 1.1.2 → 1.2.1
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.
- package/.devcontainer/.env +18 -0
- package/.devcontainer/CHANGELOG.md +68 -0
- package/.devcontainer/CLAUDE.md +100 -0
- package/.devcontainer/README.md +220 -0
- package/.devcontainer/config/main-system-prompt.md +118 -0
- package/.devcontainer/config/settings.json +41 -0
- package/.devcontainer/devcontainer.json +71 -113
- package/.devcontainer/features/README.md +113 -0
- package/.devcontainer/features/ast-grep/README.md +24 -0
- package/.devcontainer/features/ast-grep/devcontainer-feature.json +24 -0
- package/.devcontainer/features/ast-grep/install.sh +51 -0
- package/.devcontainer/features/ccstatusline/README.md +296 -0
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +19 -0
- package/.devcontainer/features/ccstatusline/install.sh +290 -0
- package/.devcontainer/features/ccusage/README.md +205 -0
- package/.devcontainer/features/ccusage/devcontainer-feature.json +38 -0
- package/.devcontainer/features/ccusage/install.sh +132 -0
- package/.devcontainer/features/claude-code/README.md +498 -0
- package/.devcontainer/features/claude-code/config/settings.json +36 -0
- package/.devcontainer/features/claude-code/config/system-prompt.md +118 -0
- package/.devcontainer/features/claude-code/config/world-building-sp.md +1432 -0
- package/.devcontainer/features/claude-code/devcontainer-feature.json +42 -0
- package/.devcontainer/features/claude-code/install.sh +466 -0
- package/.devcontainer/features/claude-monitor/README.md +74 -0
- package/.devcontainer/features/claude-monitor/devcontainer-feature.json +38 -0
- package/.devcontainer/features/claude-monitor/install.sh +99 -0
- package/.devcontainer/features/lsp-servers/README.md +85 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +34 -0
- package/.devcontainer/features/lsp-servers/install.sh +92 -0
- package/.devcontainer/features/mcp-qdrant/CHANGES.md +399 -0
- package/.devcontainer/features/mcp-qdrant/README.md +474 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +57 -0
- package/.devcontainer/features/mcp-qdrant/install.sh +295 -0
- package/.devcontainer/features/mcp-qdrant/poststart-hook.sh +129 -0
- package/.devcontainer/features/mcp-reasoner/README.md +177 -0
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +20 -0
- package/.devcontainer/features/mcp-reasoner/install.sh +177 -0
- package/.devcontainer/features/mcp-reasoner/poststart-hook.sh +67 -0
- package/.devcontainer/features/splitrail/README.md +140 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +34 -0
- package/.devcontainer/features/splitrail/install.sh +129 -0
- package/.devcontainer/features/tree-sitter/README.md +138 -0
- package/.devcontainer/features/tree-sitter/devcontainer-feature.json +52 -0
- package/.devcontainer/features/tree-sitter/install.sh +173 -0
- package/.devcontainer/scripts/setup-aliases.sh +52 -0
- package/.devcontainer/scripts/setup-config.sh +28 -0
- package/.devcontainer/scripts/setup-irie-claude.sh +32 -0
- package/.devcontainer/scripts/setup-lsp.sh +20 -0
- package/.devcontainer/scripts/setup-plugins.sh +31 -0
- package/.devcontainer/scripts/setup.sh +60 -0
- package/README.md +153 -187
- package/package.json +5 -9
- package/setup.js +2 -2
- package/.devcontainer/config/claude/mcp.json +0 -76
- package/.devcontainer/config/claude/mcp.json.template +0 -117
- package/.devcontainer/config/claude/output-styles/strict-development.md +0 -158
- package/.devcontainer/config/claude/settings.json +0 -10
- package/.devcontainer/config/claude/system-prompt.md +0 -3
- package/.devcontainer/config/searxng/ods_config.json +0 -22
- package/.devcontainer/config/searxng/searxng_env_template +0 -71
- package/.devcontainer/config/serena/serena_config.yml +0 -72
- package/.devcontainer/config/taskmaster/config.json +0 -37
- package/.devcontainer/ods_config.json +0 -21
- package/.devcontainer/post-create.sh +0 -1077
- package/.devcontainer/post-start.sh +0 -551
- package/.devcontainer/sanitize-system-prompt.sh +0 -31
- package/.devcontainer/scripts/config/claude-core.sh +0 -210
- package/.devcontainer/scripts/config/searxng.sh +0 -411
- package/.devcontainer/scripts/config/serena.sh +0 -47
- package/.devcontainer/scripts/config/taskmaster.sh +0 -41
- package/.devcontainer/scripts/generate-mcp-config.js +0 -205
- package/.devcontainer/scripts/install/claude-code.sh +0 -112
- package/.devcontainer/scripts/shell/zsh-config.sh +0 -271
- package/.devcontainer/scripts/utils.sh +0 -44
- package/.devcontainer/setup-zsh.sh +0 -234
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# ccusage - Claude Code Usage Analyzer
|
|
2
|
+
|
|
3
|
+
A DevContainer feature that installs the ccusage CLI tool for analyzing Claude Code and Codex token usage from local JSONL files.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
ccusage tracks token usage and costs across daily, monthly, and session-based reports with live monitoring capabilities. This feature configures shell aliases for easy access to the tool via `npx`.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Add this feature to your `.devcontainer/devcontainer.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"features": {
|
|
16
|
+
"ghcr.io/devcontainers/features/node:1": {},
|
|
17
|
+
"./features/ccusage": {}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### With Custom Options
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"features": {
|
|
27
|
+
"ghcr.io/devcontainers/features/node:1": {},
|
|
28
|
+
"./features/ccusage": {
|
|
29
|
+
"version": "latest",
|
|
30
|
+
"shells": "both",
|
|
31
|
+
"username": "automatic"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Options
|
|
38
|
+
|
|
39
|
+
| Option | Type | Default | Description |
|
|
40
|
+
|--------|------|---------|-------------|
|
|
41
|
+
| `version` | string | `latest` | ccusage version to use (e.g., 'latest', '1.0.0') |
|
|
42
|
+
| `shells` | string | `both` | Which shells to configure: `bash`, `zsh`, or `both` |
|
|
43
|
+
| `username` | string | `automatic` | Container user to install for (auto-detects vscode/node/codespace) |
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
Once installed, use the `ccusage` command from any shell:
|
|
48
|
+
|
|
49
|
+
### Daily Usage Report
|
|
50
|
+
```bash
|
|
51
|
+
ccusage --daily
|
|
52
|
+
```
|
|
53
|
+
Shows token usage and costs for today.
|
|
54
|
+
|
|
55
|
+
### Monthly Report
|
|
56
|
+
```bash
|
|
57
|
+
ccusage --monthly
|
|
58
|
+
```
|
|
59
|
+
Displays monthly token consumption and costs.
|
|
60
|
+
|
|
61
|
+
### Live Monitoring
|
|
62
|
+
```bash
|
|
63
|
+
ccusage --live
|
|
64
|
+
```
|
|
65
|
+
Real-time monitoring of your Claude Code usage.
|
|
66
|
+
|
|
67
|
+
### JSON Output
|
|
68
|
+
```bash
|
|
69
|
+
ccusage --json
|
|
70
|
+
```
|
|
71
|
+
Output data in JSON format for scripting/integration.
|
|
72
|
+
|
|
73
|
+
### Compact Display
|
|
74
|
+
```bash
|
|
75
|
+
ccusage --compact
|
|
76
|
+
```
|
|
77
|
+
Minimal output for quick checks.
|
|
78
|
+
|
|
79
|
+
## Features
|
|
80
|
+
|
|
81
|
+
- **Beautiful Tables**: Formatted output with clear cost breakdown
|
|
82
|
+
- **Multiple Models**: Supports Claude Opus, Sonnet, and other models
|
|
83
|
+
- **Timezone Support**: Customize timezone and locale settings
|
|
84
|
+
- **Session Tracking**: View usage by individual sessions
|
|
85
|
+
- **Cost Tracking**: Accurate pricing for different models
|
|
86
|
+
|
|
87
|
+
## How It Works
|
|
88
|
+
|
|
89
|
+
This feature creates a shell alias that points to `npx -y ccusage@<version>`, which automatically downloads and runs the latest version of ccusage without requiring a global installation.
|
|
90
|
+
|
|
91
|
+
ccusage automatically reads from Claude Code's JSONL usage logs located in:
|
|
92
|
+
- `~/.claude/` (default)
|
|
93
|
+
- `$CLAUDE_CONFIG_DIR` (if customized)
|
|
94
|
+
|
|
95
|
+
## Advanced Options
|
|
96
|
+
|
|
97
|
+
For full list of ccusage command options:
|
|
98
|
+
```bash
|
|
99
|
+
ccusage --help
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Example Configurations
|
|
103
|
+
|
|
104
|
+
### Install for Specific User (zsh only)
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"features": {
|
|
108
|
+
"./features/ccusage": {
|
|
109
|
+
"username": "vscode",
|
|
110
|
+
"shells": "zsh"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Pin to Specific Version
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"features": {
|
|
120
|
+
"./features/ccusage": {
|
|
121
|
+
"version": "1.0.0"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Bash Only Installation
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"features": {
|
|
131
|
+
"./features/ccusage": {
|
|
132
|
+
"shells": "bash"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Troubleshooting
|
|
139
|
+
|
|
140
|
+
### Command Not Found
|
|
141
|
+
|
|
142
|
+
If `ccusage` is not found after installation:
|
|
143
|
+
|
|
144
|
+
1. **Reload your shell**:
|
|
145
|
+
```bash
|
|
146
|
+
source ~/.bashrc # for bash
|
|
147
|
+
source ~/.zshrc # for zsh
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
2. **Check if alias is configured**:
|
|
151
|
+
```bash
|
|
152
|
+
grep ccusage ~/.bashrc # for bash
|
|
153
|
+
grep ccusage ~/.zshrc # for zsh
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
3. **Verify npx is available**:
|
|
157
|
+
```bash
|
|
158
|
+
npx --version
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Permission Errors
|
|
162
|
+
|
|
163
|
+
If you see permission errors:
|
|
164
|
+
```bash
|
|
165
|
+
sudo chown -R $(whoami):$(whoami) ~/.bashrc
|
|
166
|
+
sudo chown -R $(whoami):$(whoami) ~/.zshrc
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Network Issues
|
|
170
|
+
|
|
171
|
+
If ccusage fails to download:
|
|
172
|
+
- Check your internet connection
|
|
173
|
+
- The tool will be cached after first successful download
|
|
174
|
+
- Try running manually: `npx -y ccusage@latest --version`
|
|
175
|
+
|
|
176
|
+
## Dependencies
|
|
177
|
+
|
|
178
|
+
This feature requires:
|
|
179
|
+
- **Node.js**: Install the `node` feature first
|
|
180
|
+
- The feature automatically declares this dependency via `installsAfter`
|
|
181
|
+
|
|
182
|
+
## Integration with Other Tools
|
|
183
|
+
|
|
184
|
+
This tool complements:
|
|
185
|
+
- **splitrail**: Real-time monitoring during active sessions
|
|
186
|
+
- **ccstatusline**: Visual status display in terminal
|
|
187
|
+
|
|
188
|
+
## Links
|
|
189
|
+
|
|
190
|
+
- **GitHub**: https://github.com/ryoppippi/ccusage
|
|
191
|
+
- **NPM**: https://www.npmjs.com/package/ccusage
|
|
192
|
+
- **DevContainer Features**: https://containers.dev/features
|
|
193
|
+
|
|
194
|
+
## Version History
|
|
195
|
+
|
|
196
|
+
### 1.0.0
|
|
197
|
+
- Initial release as DevContainer feature
|
|
198
|
+
- Automatic user detection
|
|
199
|
+
- Configurable shell support (bash/zsh/both)
|
|
200
|
+
- Version pinning support
|
|
201
|
+
- Idempotent installation
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
This feature wrapper follows the same license as the underlying ccusage tool.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ccusage",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"name": "ccusage - Claude Code Usage Analyzer",
|
|
5
|
+
"description": "Installs ccusage CLI tool for analyzing Claude Code token usage",
|
|
6
|
+
"maintainer": "AnExiledDev",
|
|
7
|
+
"documentationURL": "https://github.com/ryoppippi/ccusage",
|
|
8
|
+
"options": {
|
|
9
|
+
"version": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "ccusage version to use (e.g., 'latest', '1.0.0')",
|
|
12
|
+
"default": "latest"
|
|
13
|
+
},
|
|
14
|
+
"shells": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Which shells to configure (bash, zsh, or both)",
|
|
17
|
+
"default": "both",
|
|
18
|
+
"enum": [
|
|
19
|
+
"bash",
|
|
20
|
+
"zsh",
|
|
21
|
+
"both"
|
|
22
|
+
],
|
|
23
|
+
"proposals": [
|
|
24
|
+
"bash",
|
|
25
|
+
"zsh",
|
|
26
|
+
"both"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"username": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Container user to install for",
|
|
32
|
+
"default": "automatic"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"installsAfter": [
|
|
36
|
+
"ghcr.io/devcontainers/features/node:1"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# === SETUP ===
|
|
5
|
+
cleanup() {
|
|
6
|
+
# No temp files needed for this simple feature
|
|
7
|
+
:
|
|
8
|
+
}
|
|
9
|
+
trap cleanup EXIT
|
|
10
|
+
|
|
11
|
+
# === IMPORT OPTIONS ===
|
|
12
|
+
# NOTE: DevContainer converts camelCase options to UPPERCASE without underscores
|
|
13
|
+
# "version" → VERSION, "shells" → SHELLS, "username" → USERNAME
|
|
14
|
+
CCUSAGE_VERSION="${VERSION:-latest}"
|
|
15
|
+
SHELLS="${SHELLS:-both}"
|
|
16
|
+
USERNAME="${USERNAME:-automatic}"
|
|
17
|
+
|
|
18
|
+
echo "[ccusage] Starting ccusage installation..."
|
|
19
|
+
|
|
20
|
+
# === SOURCE NVM ===
|
|
21
|
+
# Node is installed via NVM by the node feature
|
|
22
|
+
if [ -f /usr/local/share/nvm/nvm.sh ]; then
|
|
23
|
+
source /usr/local/share/nvm/nvm.sh
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# === VALIDATE DEPENDENCIES ===
|
|
27
|
+
if ! command -v npx &>/dev/null; then
|
|
28
|
+
echo "[ccusage] ERROR: npx is not available"
|
|
29
|
+
echo " Ensure node feature is installed first"
|
|
30
|
+
echo " NVM path: /usr/local/share/nvm/nvm.sh"
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# === VALIDATE INPUT ===
|
|
35
|
+
# Validate shells parameter
|
|
36
|
+
if [[ ! "${SHELLS}" =~ ^(bash|zsh|both)$ ]]; then
|
|
37
|
+
echo "[ccusage] ERROR: shells must be 'bash', 'zsh', or 'both'"
|
|
38
|
+
echo " Provided: ${SHELLS}"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# Validate version format (basic check)
|
|
43
|
+
if [[ ! "${CCUSAGE_VERSION}" =~ ^[a-zA-Z0-9.-]+$ ]]; then
|
|
44
|
+
echo "[ccusage] ERROR: version contains invalid characters"
|
|
45
|
+
echo " Provided: ${CCUSAGE_VERSION}"
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# === DETECT USER ===
|
|
50
|
+
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
|
|
51
|
+
USERNAME=""
|
|
52
|
+
for CURRENT_USER in vscode node codespace; do
|
|
53
|
+
if id -u "${CURRENT_USER}" >/dev/null 2>&1; then
|
|
54
|
+
USERNAME=${CURRENT_USER}
|
|
55
|
+
break
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
[ -z "${USERNAME}" ] && USERNAME=root
|
|
59
|
+
elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then
|
|
60
|
+
USERNAME=root
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
echo "[ccusage] Installing for user: ${USERNAME}"
|
|
64
|
+
|
|
65
|
+
# === GET USER HOME ===
|
|
66
|
+
USER_HOME=$(eval echo "~${USERNAME}")
|
|
67
|
+
if [ ! -d "${USER_HOME}" ]; then
|
|
68
|
+
echo "[ccusage] ERROR: Home directory not found for user ${USERNAME}"
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# === INSTALL (CREATE ALIASES) ===
|
|
73
|
+
ALIAS_CMD="alias ccusage=\"npx -y ccusage@${CCUSAGE_VERSION}\""
|
|
74
|
+
|
|
75
|
+
configure_shell() {
|
|
76
|
+
local shell_rc="$1"
|
|
77
|
+
local shell_name="$2"
|
|
78
|
+
|
|
79
|
+
if [ ! -f "${shell_rc}" ]; then
|
|
80
|
+
echo "[ccusage] Creating ${shell_name} config file: ${shell_rc}"
|
|
81
|
+
sudo -u "${USERNAME}" touch "${shell_rc}"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
if grep -q "alias ccusage=" "${shell_rc}"; then
|
|
85
|
+
echo "[ccusage] ${shell_name} alias already configured. Skipping..."
|
|
86
|
+
else
|
|
87
|
+
echo "[ccusage] Adding ccusage alias to ${shell_name}"
|
|
88
|
+
echo "${ALIAS_CMD}" >> "${shell_rc}"
|
|
89
|
+
if ! chown "${USERNAME}:${USERNAME}" "${shell_rc}" 2>/dev/null; then
|
|
90
|
+
echo "[ccusage] WARNING: Could not set ownership on ${shell_rc}"
|
|
91
|
+
echo " Fix: sudo chown ${USERNAME}:${USERNAME} ${shell_rc}"
|
|
92
|
+
fi
|
|
93
|
+
fi
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
# Configure requested shells
|
|
97
|
+
if [ "${SHELLS}" = "bash" ] || [ "${SHELLS}" = "both" ]; then
|
|
98
|
+
configure_shell "${USER_HOME}/.bashrc" "bash"
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
if [ "${SHELLS}" = "zsh" ] || [ "${SHELLS}" = "both" ]; then
|
|
102
|
+
configure_shell "${USER_HOME}/.zshrc" "zsh"
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
# === VERIFICATION ===
|
|
106
|
+
echo "[ccusage] Verifying npx can access ccusage..."
|
|
107
|
+
if sudo -u "${USERNAME}" bash -c "npx -y ccusage@${CCUSAGE_VERSION} --version" &>/dev/null; then
|
|
108
|
+
echo "[ccusage] ✓ ccusage is accessible"
|
|
109
|
+
else
|
|
110
|
+
echo "[ccusage] WARNING: Could not verify ccusage installation"
|
|
111
|
+
echo " This may be due to network connectivity"
|
|
112
|
+
echo " The alias will still work once ccusage is available"
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# === SUMMARY ===
|
|
116
|
+
echo ""
|
|
117
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
118
|
+
echo " ccusage Installation Complete"
|
|
119
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
120
|
+
echo ""
|
|
121
|
+
echo "Configuration:"
|
|
122
|
+
echo " • User: ${USERNAME}"
|
|
123
|
+
echo " • Version: ${CCUSAGE_VERSION}"
|
|
124
|
+
echo " • Shells: ${SHELLS}"
|
|
125
|
+
echo ""
|
|
126
|
+
echo "Usage:"
|
|
127
|
+
echo " ccusage --daily # Daily usage report"
|
|
128
|
+
echo " ccusage --monthly # Monthly report"
|
|
129
|
+
echo " ccusage --live # Live monitoring"
|
|
130
|
+
echo " ccusage --help # Full options"
|
|
131
|
+
echo ""
|
|
132
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|