cc-sidebar 0.1.0 → 0.1.2
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/README.md +17 -4
- package/package.json +2 -2
- package/src/cli.ts +8 -2
- package/src/components/RawSidebar.tsx +10 -14
- package/src/persistence/store.ts +13 -2
package/README.md
CHANGED
|
@@ -111,10 +111,23 @@ Keep it simple - if no clear match, don't move anything. User can manually mark
|
|
|
111
111
|
## Commands
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
cc-sidebar show
|
|
115
|
-
cc-sidebar
|
|
116
|
-
cc-sidebar spawn
|
|
117
|
-
cc-sidebar
|
|
114
|
+
cc-sidebar show # Render in current terminal
|
|
115
|
+
cc-sidebar show --dir /path # Show tasks for a specific project
|
|
116
|
+
cc-sidebar spawn # Launch in split pane (auto-detects iTerm2 vs tmux)
|
|
117
|
+
cc-sidebar spawn --tmux # Force tmux mode
|
|
118
|
+
cc-sidebar env # Show environment info
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Working with Multiple Projects
|
|
122
|
+
|
|
123
|
+
The sidebar stores tasks per-project based on the working directory. Use `--dir` to show tasks for any project without changing directories:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Show sidebar for a specific project
|
|
127
|
+
cc-sidebar show --dir ~/projects/my-app
|
|
128
|
+
|
|
129
|
+
# Create an alias for a frequent project
|
|
130
|
+
alias sidebar-app="cc-sidebar show --dir ~/projects/my-app"
|
|
118
131
|
```
|
|
119
132
|
|
|
120
133
|
## Requirements
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-sidebar",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Visual sidebar for managing todos, tasks, and context alongside Claude Code",
|
|
5
5
|
"author": "Tyler Nishida",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/thats2easyyy/claude-side-bar"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"claude",
|
package/src/cli.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { isInTmux, getEnvInfo, spawnSidebarPane } from "./terminal/tmux";
|
|
|
14
14
|
import { isInITerm, spawnITermSidebarPane, getITermEnvInfo } from "./terminal/iterm";
|
|
15
15
|
import { createIPCServer } from "./ipc/server";
|
|
16
16
|
import { sendMessage } from "./ipc/client";
|
|
17
|
-
import { getSocketPath, ensureDir } from "./persistence/store";
|
|
17
|
+
import { getSocketPath, ensureDir, setProjectDir } from "./persistence/store";
|
|
18
18
|
import { dirname } from "path";
|
|
19
19
|
import { RawSidebar } from "./components/RawSidebar";
|
|
20
20
|
|
|
@@ -24,14 +24,20 @@ import { RawSidebar } from "./components/RawSidebar";
|
|
|
24
24
|
program
|
|
25
25
|
.name("cc-sidebar")
|
|
26
26
|
.description("Visual sidebar for Claude Code")
|
|
27
|
-
.version("0.1.
|
|
27
|
+
.version("0.1.2");
|
|
28
28
|
|
|
29
29
|
// Show command - render sidebar in current terminal
|
|
30
30
|
program
|
|
31
31
|
.command("show")
|
|
32
32
|
.description("Render sidebar in current terminal")
|
|
33
33
|
.option("-s, --socket <path>", "Unix socket path for IPC")
|
|
34
|
+
.option("-d, --dir <path>", "Project directory (defaults to current directory)")
|
|
34
35
|
.action(async (options) => {
|
|
36
|
+
// Set project directory if specified
|
|
37
|
+
if (options.dir) {
|
|
38
|
+
const { resolve } = await import("path");
|
|
39
|
+
setProjectDir(resolve(options.dir));
|
|
40
|
+
}
|
|
35
41
|
ensureDir();
|
|
36
42
|
const socketPath = options.socket || getSocketPath();
|
|
37
43
|
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getTasks,
|
|
9
9
|
getStatusline,
|
|
10
10
|
getClaudeTodos,
|
|
11
|
+
getEffectiveCwd,
|
|
11
12
|
addTask,
|
|
12
13
|
updateTask,
|
|
13
14
|
removeTask,
|
|
@@ -956,20 +957,15 @@ SCRIPT
|
|
|
956
957
|
// Header padding
|
|
957
958
|
lines.push(bgLine);
|
|
958
959
|
|
|
959
|
-
// Repo and branch at top (
|
|
960
|
-
|
|
961
|
-
let
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
if (!repo) {
|
|
969
|
-
const cwd = process.cwd();
|
|
970
|
-
const parts = cwd.split('/').filter(Boolean);
|
|
971
|
-
repo = parts[parts.length - 1] || cwd;
|
|
972
|
-
}
|
|
960
|
+
// Repo and branch at top (always computed locally per-instance)
|
|
961
|
+
let branch = '';
|
|
962
|
+
let repo = '';
|
|
963
|
+
try {
|
|
964
|
+
branch = execSync('git rev-parse --abbrev-ref HEAD 2>/dev/null', { encoding: 'utf8' }).trim();
|
|
965
|
+
} catch {}
|
|
966
|
+
const cwd = getEffectiveCwd();
|
|
967
|
+
const parts = cwd.split('/').filter(Boolean);
|
|
968
|
+
repo = parts[parts.length - 1] || cwd;
|
|
973
969
|
const branchDisplay = branch ? `${branch}` : '';
|
|
974
970
|
const repoDisplay = repo ? `${repo}` : '';
|
|
975
971
|
const headerContent = branchDisplay && repoDisplay
|
package/src/persistence/store.ts
CHANGED
|
@@ -11,9 +11,20 @@ import { join } from "path";
|
|
|
11
11
|
|
|
12
12
|
const SIDEBAR_DIR = join(homedir(), ".claude-sidebar");
|
|
13
13
|
|
|
14
|
+
// Allow overriding the project directory (for --dir flag)
|
|
15
|
+
let projectDirOverride: string | null = null;
|
|
16
|
+
|
|
17
|
+
export function setProjectDir(dir: string | null): void {
|
|
18
|
+
projectDirOverride = dir;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getEffectiveCwd(): string {
|
|
22
|
+
return projectDirOverride || process.cwd();
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
// Get a short hash of the working directory for project isolation
|
|
15
26
|
function getProjectHash(): string {
|
|
16
|
-
const cwd =
|
|
27
|
+
const cwd = getEffectiveCwd();
|
|
17
28
|
return createHash("sha256").update(cwd).digest("hex").slice(0, 12);
|
|
18
29
|
}
|
|
19
30
|
|
|
@@ -31,7 +42,7 @@ function updateProjectMapping(): void {
|
|
|
31
42
|
mapping = JSON.parse(readFileSync(mappingPath, "utf-8"));
|
|
32
43
|
}
|
|
33
44
|
} catch {}
|
|
34
|
-
mapping[getProjectHash()] =
|
|
45
|
+
mapping[getProjectHash()] = getEffectiveCwd();
|
|
35
46
|
ensureDir();
|
|
36
47
|
mkdirSync(join(SIDEBAR_DIR, "projects"), { recursive: true });
|
|
37
48
|
writeFileSync(mappingPath, JSON.stringify(mapping, null, 2));
|