ai-session-manager 0.1.3__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fatih Tekin
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.
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-session-manager
3
+ Version: 0.1.3
4
+ Summary: Per-project session persistence for AI CLI tools
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/DrFatihTekin/ai-session-manager
7
+ Project-URL: Repository, https://github.com/DrFatihTekin/ai-session-manager
8
+ Keywords: ai,cli,session,wrapper,copilot,claude,codex,gemini
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # ai-session-manager
19
+
20
+ > Per-project session persistence for AI CLI tools.
21
+
22
+ `ai-session-manager` adds automatic project-scoped resume behavior to supported AI CLIs so you can leave a project and come back without manually reopening the right conversation.
23
+
24
+ Works on **Linux**, **macOS**, and **Windows**.
25
+
26
+ > [!WARNING]
27
+ > This tool renames installed CLI binaries and replaces them with wrapper scripts. Use it at your own risk, and make sure you understand how to restore the original binaries with `ai-session-manager teardown`.
28
+
29
+ ---
30
+
31
+ ## Why
32
+
33
+ Most AI CLIs support sessions, but they do not all resume the same way and they do not all make project-scoped resume automatic. This project adds one consistent wrapper layer across tools.
34
+
35
+ Today it supports:
36
+
37
+ | Tool | Auto-resume behavior |
38
+ |---|---|
39
+ | `agy` | After first run, launches `agy -c` in the same project |
40
+ | `copilot` | Stores a stable session UUID and launches `copilot --session-id <uuid>` |
41
+ | `claude` | After first run, launches `claude -c` in the same project |
42
+ | `gemini` | After first run, launches `gemini --resume` in the same project |
43
+ | `codex` | After first run, launches `codex resume --last` in the same project |
44
+
45
+ Project-scoped state lives in:
46
+
47
+ - `.ai-session-manager/` inside the project root, whether it is a git repo or a plain folder
48
+
49
+ Existing state is still recognized and migrated from:
50
+
51
+ - `.git/ai-session-manager/`
52
+
53
+ Copilot legacy state is also recognized and migrated from:
54
+
55
+ - `.git/copilot-session`
56
+ - `.copilot-session`
57
+
58
+ ---
59
+
60
+ ## Requirements
61
+
62
+ - Python 3.8+
63
+ - One or more supported CLIs installed: Antigravity, Copilot, Claude Code, Gemini CLI, or Codex CLI
64
+
65
+ ---
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ pip install --editable ~/ai-session-manager
71
+ ```
72
+
73
+ Once published:
74
+
75
+ ```bash
76
+ pip install ai-session-manager
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Setup
82
+
83
+ Install wrappers for every supported tool found in `PATH`:
84
+
85
+ ```bash
86
+ ai-session-manager setup
87
+ ```
88
+
89
+ Or target specific tools:
90
+
91
+ ```bash
92
+ ai-session-manager setup agy copilot claude gemini codex
93
+ ```
94
+
95
+ Each selected binary is renamed to `<tool>-real` and replaced with a thin Python wrapper. From that point on, keep using the original command name.
96
+
97
+ ---
98
+
99
+ ## Usage
100
+
101
+ ### Copilot
102
+
103
+ ```bash
104
+ cd ~/my-project
105
+ copilot
106
+ # [ai-session-manager] New session 4f1a2b3c-... (my-project)
107
+
108
+ cd ~/my-project
109
+ copilot
110
+ # [ai-session-manager] Resuming session 4f1a2b3c-... (my-project)
111
+ ```
112
+
113
+ ### AGY / Claude / Gemini / Codex
114
+
115
+ ```bash
116
+ agy
117
+ # [ai-session-manager] Starting new Antigravity CLI session (my-project)
118
+ agy
119
+ # [ai-session-manager] Resuming latest Antigravity CLI session (my-project)
120
+
121
+ claude
122
+ # [ai-session-manager] Starting new Claude Code session (my-project)
123
+ claude
124
+ # [ai-session-manager] Resuming latest Claude Code session (my-project)
125
+
126
+ gemini
127
+ # [ai-session-manager] Starting new Gemini CLI session (my-project)
128
+ gemini
129
+ # [ai-session-manager] Resuming latest Gemini CLI session (my-project)
130
+
131
+ codex
132
+ # [ai-session-manager] Starting new Codex session (my-project)
133
+ codex
134
+ # [ai-session-manager] Resuming latest Codex session (my-project)
135
+ ```
136
+
137
+ Supported tools are still fully usable with their own native session commands. If you pass an explicit resume or session-management flag/subcommand, the wrapper gets out of the way.
138
+
139
+ For example:
140
+
141
+ ```bash
142
+ agy --conversation 123e4567-e89b-12d3-a456-426614174000
143
+ copilot --resume
144
+ claude -r my-session
145
+ gemini --list-sessions
146
+ codex resume --last
147
+ ```
148
+
149
+ ### Start fresh in the current project
150
+
151
+ ```bash
152
+ ai-session-manager reset
153
+ ```
154
+
155
+ Or reset one tool only:
156
+
157
+ ```bash
158
+ ai-session-manager reset claude
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Commands
164
+
165
+ | Command | Description |
166
+ |---|---|
167
+ | `ai-session-manager setup [tools...]` | Install wrappers for all detected or selected tools |
168
+ | `ai-session-manager teardown [tools...]` | Remove wrappers and restore original binaries |
169
+ | `ai-session-manager status [tools...]` | Show platform, binary paths, and state files |
170
+ | `ai-session-manager reset [tools...]` | Delete persisted wrapper state for the current project |
171
+
172
+ ---
173
+
174
+ ## State layout
175
+
176
+ ```text
177
+ project root:
178
+ .ai-session-manager/
179
+ copilot.json
180
+ claude.json
181
+ codex.json
182
+ gemini.json
183
+ agy.json
184
+ ```
185
+
186
+ Copilot stores a generated UUID in its state file. The other tools use the file as an on/off marker that tells the wrapper to invoke the tool's native resume-latest behavior on future launches.
187
+
188
+ ### Platform details
189
+
190
+ | | Linux | macOS | Windows |
191
+ |---|---|---|---|
192
+ | Wrapper file | tool name (shebang script) | tool name (shebang script) | tool `.cmd` wrapper |
193
+ | Real binary | `<tool>-real` | `<tool>-real` | `<tool>-real.exe` or `<tool>-real.cmd` |
194
+ | Process launch | `os.execv` (true replace) | `os.execv` (true replace) | `subprocess` + exit code |
195
+
196
+ ### Project structure
197
+
198
+ ```text
199
+ ai-session-manager/
200
+ ├── pyproject.toml
201
+ ├── README.md
202
+ └── src/
203
+ ├── ai_session_manager/
204
+ │ ├── wrapper.py
205
+ │ └── cli.py
206
+ ```
207
+
208
+ ---
209
+
210
+ ## Reinstalling a tool CLI
211
+
212
+ If a wrapped tool is manually reinstalled and overwrites the wrapper, run setup again:
213
+
214
+ ```bash
215
+ ai-session-manager setup copilot
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Uninstall
221
+
222
+ ```bash
223
+ ai-session-manager teardown
224
+ pip uninstall ai-session-manager
225
+ ```
226
+
227
+ ---
228
+
229
+ ## License
230
+
231
+ MIT
@@ -0,0 +1,214 @@
1
+ # ai-session-manager
2
+
3
+ > Per-project session persistence for AI CLI tools.
4
+
5
+ `ai-session-manager` adds automatic project-scoped resume behavior to supported AI CLIs so you can leave a project and come back without manually reopening the right conversation.
6
+
7
+ Works on **Linux**, **macOS**, and **Windows**.
8
+
9
+ > [!WARNING]
10
+ > This tool renames installed CLI binaries and replaces them with wrapper scripts. Use it at your own risk, and make sure you understand how to restore the original binaries with `ai-session-manager teardown`.
11
+
12
+ ---
13
+
14
+ ## Why
15
+
16
+ Most AI CLIs support sessions, but they do not all resume the same way and they do not all make project-scoped resume automatic. This project adds one consistent wrapper layer across tools.
17
+
18
+ Today it supports:
19
+
20
+ | Tool | Auto-resume behavior |
21
+ |---|---|
22
+ | `agy` | After first run, launches `agy -c` in the same project |
23
+ | `copilot` | Stores a stable session UUID and launches `copilot --session-id <uuid>` |
24
+ | `claude` | After first run, launches `claude -c` in the same project |
25
+ | `gemini` | After first run, launches `gemini --resume` in the same project |
26
+ | `codex` | After first run, launches `codex resume --last` in the same project |
27
+
28
+ Project-scoped state lives in:
29
+
30
+ - `.ai-session-manager/` inside the project root, whether it is a git repo or a plain folder
31
+
32
+ Existing state is still recognized and migrated from:
33
+
34
+ - `.git/ai-session-manager/`
35
+
36
+ Copilot legacy state is also recognized and migrated from:
37
+
38
+ - `.git/copilot-session`
39
+ - `.copilot-session`
40
+
41
+ ---
42
+
43
+ ## Requirements
44
+
45
+ - Python 3.8+
46
+ - One or more supported CLIs installed: Antigravity, Copilot, Claude Code, Gemini CLI, or Codex CLI
47
+
48
+ ---
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install --editable ~/ai-session-manager
54
+ ```
55
+
56
+ Once published:
57
+
58
+ ```bash
59
+ pip install ai-session-manager
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Setup
65
+
66
+ Install wrappers for every supported tool found in `PATH`:
67
+
68
+ ```bash
69
+ ai-session-manager setup
70
+ ```
71
+
72
+ Or target specific tools:
73
+
74
+ ```bash
75
+ ai-session-manager setup agy copilot claude gemini codex
76
+ ```
77
+
78
+ Each selected binary is renamed to `<tool>-real` and replaced with a thin Python wrapper. From that point on, keep using the original command name.
79
+
80
+ ---
81
+
82
+ ## Usage
83
+
84
+ ### Copilot
85
+
86
+ ```bash
87
+ cd ~/my-project
88
+ copilot
89
+ # [ai-session-manager] New session 4f1a2b3c-... (my-project)
90
+
91
+ cd ~/my-project
92
+ copilot
93
+ # [ai-session-manager] Resuming session 4f1a2b3c-... (my-project)
94
+ ```
95
+
96
+ ### AGY / Claude / Gemini / Codex
97
+
98
+ ```bash
99
+ agy
100
+ # [ai-session-manager] Starting new Antigravity CLI session (my-project)
101
+ agy
102
+ # [ai-session-manager] Resuming latest Antigravity CLI session (my-project)
103
+
104
+ claude
105
+ # [ai-session-manager] Starting new Claude Code session (my-project)
106
+ claude
107
+ # [ai-session-manager] Resuming latest Claude Code session (my-project)
108
+
109
+ gemini
110
+ # [ai-session-manager] Starting new Gemini CLI session (my-project)
111
+ gemini
112
+ # [ai-session-manager] Resuming latest Gemini CLI session (my-project)
113
+
114
+ codex
115
+ # [ai-session-manager] Starting new Codex session (my-project)
116
+ codex
117
+ # [ai-session-manager] Resuming latest Codex session (my-project)
118
+ ```
119
+
120
+ Supported tools are still fully usable with their own native session commands. If you pass an explicit resume or session-management flag/subcommand, the wrapper gets out of the way.
121
+
122
+ For example:
123
+
124
+ ```bash
125
+ agy --conversation 123e4567-e89b-12d3-a456-426614174000
126
+ copilot --resume
127
+ claude -r my-session
128
+ gemini --list-sessions
129
+ codex resume --last
130
+ ```
131
+
132
+ ### Start fresh in the current project
133
+
134
+ ```bash
135
+ ai-session-manager reset
136
+ ```
137
+
138
+ Or reset one tool only:
139
+
140
+ ```bash
141
+ ai-session-manager reset claude
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Commands
147
+
148
+ | Command | Description |
149
+ |---|---|
150
+ | `ai-session-manager setup [tools...]` | Install wrappers for all detected or selected tools |
151
+ | `ai-session-manager teardown [tools...]` | Remove wrappers and restore original binaries |
152
+ | `ai-session-manager status [tools...]` | Show platform, binary paths, and state files |
153
+ | `ai-session-manager reset [tools...]` | Delete persisted wrapper state for the current project |
154
+
155
+ ---
156
+
157
+ ## State layout
158
+
159
+ ```text
160
+ project root:
161
+ .ai-session-manager/
162
+ copilot.json
163
+ claude.json
164
+ codex.json
165
+ gemini.json
166
+ agy.json
167
+ ```
168
+
169
+ Copilot stores a generated UUID in its state file. The other tools use the file as an on/off marker that tells the wrapper to invoke the tool's native resume-latest behavior on future launches.
170
+
171
+ ### Platform details
172
+
173
+ | | Linux | macOS | Windows |
174
+ |---|---|---|---|
175
+ | Wrapper file | tool name (shebang script) | tool name (shebang script) | tool `.cmd` wrapper |
176
+ | Real binary | `<tool>-real` | `<tool>-real` | `<tool>-real.exe` or `<tool>-real.cmd` |
177
+ | Process launch | `os.execv` (true replace) | `os.execv` (true replace) | `subprocess` + exit code |
178
+
179
+ ### Project structure
180
+
181
+ ```text
182
+ ai-session-manager/
183
+ ├── pyproject.toml
184
+ ├── README.md
185
+ └── src/
186
+ ├── ai_session_manager/
187
+ │ ├── wrapper.py
188
+ │ └── cli.py
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Reinstalling a tool CLI
194
+
195
+ If a wrapped tool is manually reinstalled and overwrites the wrapper, run setup again:
196
+
197
+ ```bash
198
+ ai-session-manager setup copilot
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Uninstall
204
+
205
+ ```bash
206
+ ai-session-manager teardown
207
+ pip uninstall ai-session-manager
208
+ ```
209
+
210
+ ---
211
+
212
+ ## License
213
+
214
+ MIT
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ai-session-manager"
7
+ version = "0.1.3"
8
+ description = "Per-project session persistence for AI CLI tools"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ keywords = ["ai", "cli", "session", "wrapper", "copilot", "claude", "codex", "gemini"]
14
+ classifiers = [
15
+ "Environment :: Console",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ ]
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/DrFatihTekin/ai-session-manager"
23
+ Repository = "https://github.com/DrFatihTekin/ai-session-manager"
24
+
25
+ [project.scripts]
26
+ ai-session-manager = "ai_session_manager.cli:main"
27
+
28
+ [tool.setuptools.packages.find]
29
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """ai-session-manager package."""