cc-sessions 1.0.1 → 1.0.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.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +23 -13
  4. data/bin/cc +1 -1
  5. data/bin/cc-bookmark +37 -0
  6. data/commands/bm.md +7 -35
  7. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acd63dc92da6821889b1e5c397a8ebe74aba5d571f36d859425bda641b5666e2
4
- data.tar.gz: ee05bf07a43c3bda1b42caf7a3787833a8ed28d69d182f211fdc7542e0f6fbfa
3
+ metadata.gz: 76dc4063f182c1d78b8eead156b8e57ffe2728198e72ae30efbcd3234a7fc2a6
4
+ data.tar.gz: 4f739bbcde871c0db6b0473480ab2063d7777ea1ab73f5051fa7c6c6dc104b5d
5
5
  SHA512:
6
- metadata.gz: 89789ae0e1d1933496a153df188e6df4b30220fcb3ba9ae9d202949b1eacd681b562238c3fa009b0bf52fdeca723b2738dd56af2a6ec1fc2a75ce17ed7e851cf
7
- data.tar.gz: cf407c8d028ac237dcb2fea7bbd2889e94ee174ab07125de718af8bddf62a382a2d9ac7542696fec7dadb5b051f945d9906ff33ebb20594aba256f30e2d0ac10
6
+ metadata.gz: 6998837a2bde9b9ce143d47f85d39e5cf1d12ac010849c8971ad1470b7e31d67a712668530a4fa960300e61140fa54e677ade91151bed102805ca4cf8e95cc1c
7
+ data.tar.gz: 2990b688c7cef2a6c87559aa5ed8d6ecd933a4741f84c4af8d965024297a11bc9ef52c7948a81d82da5bd2f8eabeb3e77481cfe594a8fecdfd8423f11722e12d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.2] - 2025-01-23
4
+
5
+ ### Added
6
+ - `cc-bookmark` helper script for reliable permission matching
7
+ - SVG logo
8
+
9
+ ### Changed
10
+ - `/bm` command now uses `cc-bookmark` script (auto-accepts without prompts)
11
+ - Updated README with badges and proper logo placement
12
+
3
13
  ## [1.0.1] - 2025-01-23
4
14
 
5
15
  ### Added
data/README.md CHANGED
@@ -1,32 +1,38 @@
1
1
  # CC-sessions
2
2
 
3
- A simple tool for bookmarking and resuming Claude Code sessions with tags.
3
+ ![Ruby](https://img.shields.io/badge/language-Ruby-red) [![Gem Version](https://badge.fury.io/rb/cc-sessions.svg)](https://badge.fury.io/rb/cc-sessions) ![Unlicense](https://img.shields.io/badge/license-Unlicense-green)
4
+
5
+ <img src="img/cc-sessions_logo.svg" align="left" width="150" height="150">
4
6
 
5
- ## The Problem
7
+ A simple tool for bookmarking and resuming Claude Code sessions with tags.
6
8
 
7
9
  Claude Code sessions are tied to directories, making it hard to remember where
8
10
  you were working on specific projects. This tool lets you tag sessions with
9
11
  meaningful names and quickly resume them.
10
12
 
13
+ <br clear="left"/>
14
+
11
15
  ## Features
12
16
 
13
17
  - **Bookmark sessions** with `/bm tag1 tag2` inside Claude Code
14
18
  - **Resume sessions** with `cc tag` from anywhere
15
19
  - **List bookmarks** with `cc -l`
16
- - **Auto-install** the `/bm` command on first run
20
+ - **Auto-install** the `/bm` command and permission on first run
17
21
 
18
22
  ## Installation
19
23
 
24
+ ### From RubyGems (Recommended)
25
+
20
26
  ```bash
21
- # Clone the repository
22
- git clone https://github.com/isene/CC-sessions.git
23
- cd CC-sessions
27
+ gem install cc-sessions
28
+ ```
24
29
 
25
- # Add to your PATH (add to .zshrc or .bashrc)
26
- export PATH="$HOME/path/to/CC-sessions/bin:$PATH"
30
+ ### From Source
27
31
 
28
- # Or create a symlink
29
- ln -sf /path/to/CC-sessions/bin/cc ~/bin/cc
32
+ ```bash
33
+ git clone https://github.com/isene/CC-sessions.git
34
+ cd CC-sessions
35
+ ./install.sh
30
36
  ```
31
37
 
32
38
  ## Usage
@@ -60,8 +66,11 @@ cc -h
60
66
 
61
67
  ### First Run
62
68
 
63
- On first run, `cc` automatically installs the `/bm` command to `~/.claude/commands/`.
64
- This enables the `/bm` command inside Claude Code.
69
+ On first run, `cc` automatically:
70
+ 1. Installs the `/bm` command to `~/.claude/commands/`
71
+ 2. Adds auto-accept permission to `~/.claude/settings.json`
72
+
73
+ This enables `/bm` to work without confirmation prompts.
65
74
 
66
75
  ## Files
67
76
 
@@ -69,6 +78,7 @@ This enables the `/bm` command inside Claude Code.
69
78
  |------|---------|
70
79
  | `~/.cc-sessions/bookmarks.json` | Stores your bookmarks |
71
80
  | `~/.claude/commands/bm.md` | The `/bm` command definition |
81
+ | `~/.claude/settings.json` | Permission for auto-accept |
72
82
 
73
83
  ## Example Workflow
74
84
 
@@ -91,4 +101,4 @@ cc rtfm # Instantly back in that session
91
101
 
92
102
  ## License
93
103
 
94
- MIT
104
+ This software is released into the public domain under [The Unlicense](https://unlicense.org/).
data/bin/cc CHANGED
@@ -21,7 +21,7 @@ BOOKMARKS_FILE = File.join(CONFIG_DIR, 'bookmarks.json')
21
21
  COMMAND_SOURCE = File.expand_path('../commands/bm.md', __dir__)
22
22
  COMMAND_DEST = File.expand_path('~/.claude/commands/bm.md')
23
23
  SETTINGS_FILE = File.expand_path('~/.claude/settings.json')
24
- BM_PERMISSION = 'Bash(mkdir -p ~/.cc-sessions && ruby -rjson:*)'
24
+ BM_PERMISSION = 'Bash(cc-bookmark:*)'
25
25
 
26
26
  def ensure_setup
27
27
  # Create config directory
data/bin/cc-bookmark ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # CC-Bookmark - Helper script for /bm command
5
+ # Bookmarks the current directory with tags
6
+
7
+ require 'json'
8
+ require 'fileutils'
9
+
10
+ CONFIG_DIR = File.expand_path('~/.cc-sessions')
11
+ BOOKMARKS_FILE = File.join(CONFIG_DIR, 'bookmarks.json')
12
+
13
+ FileUtils.mkdir_p(CONFIG_DIR) unless Dir.exist?(CONFIG_DIR)
14
+
15
+ bookmarks = if File.exist?(BOOKMARKS_FILE)
16
+ JSON.parse(File.read(BOOKMARKS_FILE))
17
+ else
18
+ {}
19
+ end
20
+
21
+ cwd = Dir.pwd
22
+ tags = ARGV
23
+
24
+ if tags.empty?
25
+ if bookmarks[cwd]
26
+ puts "Current bookmark: #{bookmarks[cwd].join(', ')}"
27
+ else
28
+ puts "No bookmark for this directory. Usage: /bm tag1 tag2 ..."
29
+ end
30
+ else
31
+ bookmarks[cwd] = tags
32
+ File.write(BOOKMARKS_FILE, JSON.pretty_generate(bookmarks))
33
+ puts "Bookmarked: #{cwd}"
34
+ puts "Tags: #{tags.join(', ')}"
35
+ puts ""
36
+ puts "Resume later with: cc #{tags.first}"
37
+ end
data/commands/bm.md CHANGED
@@ -10,44 +10,16 @@ The user provides space-separated tags after `/bm`. For example:
10
10
 
11
11
  ## What to Do
12
12
 
13
- 1. Get the current working directory (this is the session path)
14
- 2. Parse the tags from the command arguments (the text after `/bm`)
15
- 3. Store the bookmark in `~/.cc-sessions/bookmarks.json`
16
- 4. If no tags provided, show current bookmark for this directory (if any)
17
-
18
- ## Implementation
19
-
20
- Run this bash command, replacing `$TAGS` with the actual tags provided:
13
+ Run the cc-bookmark command with the provided tags:
21
14
 
22
15
  ```bash
23
- mkdir -p ~/.cc-sessions && ruby -rjson -e '
24
- file = File.expand_path("~/.cc-sessions/bookmarks.json")
25
- bookmarks = File.exist?(file) ? JSON.parse(File.read(file)) : {}
26
- cwd = Dir.pwd
27
- tags = ARGV
28
- if tags.empty?
29
- if bookmarks[cwd]
30
- puts "Current bookmark: #{bookmarks[cwd].join(", ")}"
31
- else
32
- puts "No bookmark for this directory. Usage: /bm tag1 tag2 ..."
33
- end
34
- else
35
- bookmarks[cwd] = tags
36
- File.write(file, JSON.pretty_generate(bookmarks))
37
- puts "Bookmarked: #{cwd}"
38
- puts "Tags: #{tags.join(", ")}"
39
- puts ""
40
- puts "Resume later with: cc #{tags.first}"
41
- end
42
- ' $TAGS
16
+ cc-bookmark $TAGS
43
17
  ```
44
18
 
45
- ## Response Format
19
+ Replace `$TAGS` with the actual tags provided by the user.
46
20
 
47
- After bookmarking, confirm:
48
- ```
49
- Bookmarked: /path/to/session
50
- Tags: tag1, tag2, tag3
21
+ ## Example
51
22
 
52
- Resume later with: cc tag1
53
- ```
23
+ User types: `/bm rtfm ruby`
24
+
25
+ Run: `cc-bookmark rtfm ruby`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cc-sessions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -17,6 +17,7 @@ email:
17
17
  - g@isene.com
18
18
  executables:
19
19
  - cc
20
+ - cc-bookmark
20
21
  extensions: []
21
22
  extra_rdoc_files: []
22
23
  files:
@@ -24,6 +25,7 @@ files:
24
25
  - LICENSE
25
26
  - README.md
26
27
  - bin/cc
28
+ - bin/cc-bookmark
27
29
  - commands/bm.md
28
30
  homepage: https://github.com/isene/CC-sessions
29
31
  licenses: