devin-cli 1.1.2__tar.gz → 1.1.4__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.
Files changed (55) hide show
  1. {devin_cli-1.1.2 → devin_cli-1.1.4}/CHANGELOG.md +17 -0
  2. {devin_cli-1.1.2 → devin_cli-1.1.4}/PKG-INFO +101 -40
  3. devin_cli-1.1.4/README.md +195 -0
  4. {devin_cli-1.1.2 → devin_cli-1.1.4}/pyproject.toml +1 -1
  5. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/client.py +0 -3
  6. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/knowledge.py +0 -2
  7. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/cli.py +37 -15
  8. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_cli.py +1 -1
  9. devin_cli-1.1.2/README.md +0 -134
  10. devin_cli-1.1.2/test_duplicate.py +0 -19
  11. {devin_cli-1.1.2 → devin_cli-1.1.4}/.github/workflows/pypi-publish.yml +0 -0
  12. {devin_cli-1.1.2 → devin_cli-1.1.4}/.gitignore +0 -0
  13. {devin_cli-1.1.2 → devin_cli-1.1.4}/LICENSE +0 -0
  14. {devin_cli-1.1.2 → devin_cli-1.1.4}/assets/logo.png +0 -0
  15. {devin_cli-1.1.2 → devin_cli-1.1.4}/generate_facades.py +0 -0
  16. {devin_cli-1.1.2 → devin_cli-1.1.4}/setup.py +0 -0
  17. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/__init__.py +0 -0
  18. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/__init__.py +0 -0
  19. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/attachments.py +0 -0
  20. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/consumption.py +0 -0
  21. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/knowledge.py +0 -0
  22. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/members.py +0 -0
  23. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/organizations.py +0 -0
  24. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/playbooks.py +0 -0
  25. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/repositories.py +0 -0
  26. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/schedules.py +0 -0
  27. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/secrets.py +0 -0
  28. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/sessions.py +0 -0
  29. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/__init__.py +0 -0
  30. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/attachments.py +0 -0
  31. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/playbooks.py +0 -0
  32. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/secrets.py +0 -0
  33. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v1/sessions.py +0 -0
  34. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/__init__.py +0 -0
  35. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/attachments.py +0 -0
  36. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/consumption.py +0 -0
  37. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/knowledge.py +0 -0
  38. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/members.py +0 -0
  39. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/organizations.py +0 -0
  40. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/playbooks.py +0 -0
  41. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/repositories.py +0 -0
  42. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/schedules.py +0 -0
  43. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/secrets.py +0 -0
  44. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/api/v3/sessions.py +0 -0
  45. {devin_cli-1.1.2 → devin_cli-1.1.4}/src/devin_cli/config.py +0 -0
  46. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/__init__.py +0 -0
  47. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/conftest.py +0 -0
  48. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_attachments.py +0 -0
  49. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_knowledge.py +0 -0
  50. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_playbooks.py +0 -0
  51. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_repositories.py +0 -0
  52. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_schedules.py +0 -0
  53. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_secrets.py +0 -0
  54. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_api/test_sessions.py +0 -0
  55. {devin_cli-1.1.2 → devin_cli-1.1.4}/tests/test_config.py +0 -0
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.4] - 2026-03-11
9
+ ### Fixed
10
+ - Fixed `NameError` crash in `v1/knowledge.py` (`macro` referenced but never declared as a parameter).
11
+ - Fixed typo in advanced mode session output message.
12
+ - Removed stale inline comments from `client.py` and `cli.py`.
13
+
14
+ ### Changed
15
+ - Updated README with dedicated sections for v1 legacy API support, multi-profile management, session deduplication, and environment variable reference.
16
+
17
+ ## [1.1.3] - 2026-03-11
18
+ ### Fixed
19
+ - `repos list` now resolves blank Path column by trying `repository_path`, `path`, and `name` keys from the API response.
20
+ - `secrets list` no longer crashes when the API returns a raw list instead of a dict with a key.
21
+ - `sessions cost <id>` now pulls cost data from the org-scoped `get_session` endpoint instead of the enterprise-only consumption path.
22
+ - `sessions insights` on v1 now displays a readable error with a hint to switch to v3 instead of a confusing JSON blob.
23
+ - `--json` flag added to `repos list` and `secrets list` for raw programmatic output.
24
+
8
25
  ## [1.1.2] - 2026-03-11
9
26
  ### Fixed
10
27
  - **Critical Profile Bug**: Stopped `cli.py` from statically overriding the active user profile back to `"default"` on every boot unless the `--profile` flag is explicitly passed over the terminal.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devin-cli
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: Unofficial CLI for Devin AI - The first AI Software Engineer
5
5
  Project-URL: Homepage, https://github.com/revanthpobala/devin-cli
6
6
  Project-URL: Repository, https://github.com/revanthpobala/devin-cli.git
@@ -46,9 +46,9 @@ Description-Content-Type: text/markdown
46
46
  <a href="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml"><img src="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml/badge.svg" alt="Build Status"></a>
47
47
  </p>
48
48
 
49
- > **The first unofficial CLI for the world's first AI Software Engineer. Now upgraded to v1.1.0 with Multi-Profile support and legacy v1 backward-compatibility.**
49
+ > **The first unofficial CLI for the world's first AI Software Engineer. Supports both the modern v3 API and the legacy v1 API with full multi-profile management.**
50
50
 
51
- Devin CLI is designed for high-velocity engineering teams. It strips away the friction of the web UI, allowing you to orchestrate autonomous agents, manage complex contexts, and automate multi-step development workflows through a robust, terminal-first interface. Built for performance, SEO, and developer productivity.
51
+ Devin CLI is designed for high-velocity engineering teams. It strips away the friction of the web UI, allowing you to orchestrate autonomous agents, manage complex contexts, and automate multi-step development workflows through a robust, terminal-first interface.
52
52
 
53
53
  ---
54
54
 
@@ -75,67 +75,115 @@ pip install devin-cli
75
75
  ### 2. Configuration
76
76
  ```bash
77
77
  devin configure
78
- # Paste your v3 API token (apk_... or cog_...) from https://preview.devin.ai/settings
79
- # Optionally configure your Organization ID here.
78
+ # Paste your API token (apk_... or cog_...) from https://preview.devin.ai/settings
79
+ # Select API version: v3 (default) or v1 (legacy)
80
80
  ```
81
81
 
82
82
  ### 3. Your First Session
83
83
  ```bash
84
- devin sessions create -t "Identify and fix the race condition in our Redis cache layer"
84
+ devin sessions create "Identify and fix the race condition in our Redis cache layer"
85
85
  ```
86
86
 
87
- ## 🌟 What's New in v1.1.0
87
+ ---
88
+
89
+ ## 🔑 Multi-Profile Support
90
+
91
+ The CLI supports multiple named profiles, letting you manage separate tokens, organizations, and API versions from a single install.
92
+
93
+ ```bash
94
+ # Configure your personal v3 profile
95
+ devin configure --profile personal
88
96
 
89
- - **Dual-Token Profiles:** Seamlessly switch between personal (`apk_user_`) and Service Account (`cog_`) tokens on the fly using `--profile`.
90
- - `devin configure --profile service`
91
- - `devin --profile service sessions list`
92
- - **Legacy v1 Backward Compatibility:** Need to run an older integration that depends on the original Devin API shapes? The CLI now acts as a dynamic proxy. Simply configure a profile to use `api_version: v1`, and the CLI will route authentic payloads directly to the deprecated v1 endpoints without breaking your v3 integrations.
93
- - **Session Deduplication (Anti-Spam):** Avoid burning ACUs on accidental retries. The CLI now actively caches a SHA-256 hash of your last 50 prompts per profile, immediately halting and alerting you if you attempt to launch a duplicate session.
94
- - **Advanced Mode Auth:** Automatically traps `advanced_mode_url` requirements and securely prompts you to finish the connection handshake directly in your web browser.
97
+ # Configure a service account profile
98
+ devin configure --profile service
99
+
100
+ # Switch profiles at runtime
101
+ devin --profile service sessions list
102
+ devin --profile personal sessions create "Fix the failing tests"
103
+ ```
104
+
105
+ Profiles are stored in `~/.config/devin/config.json` and are fully isolated — including their session deduplication caches and active session IDs.
95
106
 
96
107
  ---
97
108
 
98
- ## 🛠 Command Cheat Sheet (v3 Architecture)
109
+ ## 🕹 Legacy v1 API Support
99
110
 
100
- The v3 architecture introduces a modular, hierarchical CLI structure focusing on enterprise features, secrets, and organizational management. Every sub-command supports the `--org` flag to override your active organization on the fly.
111
+ If you are running an older integration against the original Devin API v1 endpoints, the CLI acts as a transparent proxy and routes calls to the correct v1 URLs without breaking your v3 integrations.
112
+
113
+ **To configure a v1 profile:**
114
+ ```bash
115
+ devin configure --profile legacy
116
+ # When prompted for API Version, enter: v1
117
+ # Set Base URL to: https://api.devin.ai/v1
118
+ ```
119
+
120
+ **To use the v1 profile:**
121
+ ```bash
122
+ devin --profile legacy sessions create "Run the migration script"
123
+ devin --profile legacy sessions list
124
+ ```
125
+
126
+ **What works in v1:**
127
+
128
+ | Feature | v1 | v3 |
129
+ | :--- | :---: | :---: |
130
+ | Sessions (create, list, get, terminate) | ✅ | ✅ |
131
+ | Knowledge (create, update, delete) | ✅ | ✅ |
132
+ | Playbooks (create, update, delete) | ✅ | ✅ |
133
+ | Secrets (list, create, delete) | ✅ | ✅ |
134
+ | Attachments (upload, download) | ✅ | ✅ |
135
+ | Session Insights | ❌ | ✅ |
136
+ | Schedules | ❌ | ✅ |
137
+ | Repositories | ❌ | ✅ |
138
+ | Enterprise endpoints | ❌ | ✅ |
139
+
140
+ > The help menu will show `(Legacy v1 API)` and `(v3 Only)` tags next to commands when a v1 profile is active.
141
+
142
+ ---
143
+
144
+ ## 🛠 Command Reference
145
+
146
+ Every sub-command supports the `--org` flag to override your active organization on the fly.
101
147
 
102
148
  | Category | Commands | Description |
103
149
  | :--- | :--- | :--- |
104
150
  | **Sessions** | `create`, `list`, `get`, `insights`, `cost`, `messages`, `message`, `terminate` | Core agent lifecycle and analytics. |
105
151
  | **Knowledge** | `list`, `create`, `delete` | Manage organizational context and AI memory. |
106
- | **Playbooks** | `list`, `create`, `delete` | Automate complex, multi-step agent workflows. |
107
- | **Secrets** | `list`, `create`, `delete` | Manage API keys passing to Devin sessions. |
152
+ | **Playbooks** | `list`, `create`, `update`, `delete` | Automate complex, multi-step agent workflows. |
153
+ | **Secrets** | `list`, `create`, `delete` | Pass API keys and credentials to Devin sessions. |
108
154
  | **Schedules** | `list`, `create` | Schedule recurring autonomous tasks via CRON. |
109
- | **Repositories** | `list`, `index` | Force indexing of Git repositories. |
155
+ | **Repositories** | `list`, `index` | Force indexing of Git repositories for Devin context. |
110
156
  | **Attachments** | `upload`, `download` | Transfer context files seamlessly. |
111
157
  | **Enterprise** | `whoami`, `list-orgs` | Administrative identity discovery. |
112
- | **Global** | `configure`, `use` | CLI setup and active session swapping. |
158
+ | **Global** | `configure`, `use` | CLI setup and active session management. |
113
159
 
114
- ### Example Automations
160
+ ### Key Flags
115
161
 
116
- **Blocking Call for CI/CD:**
117
- ```bash
118
- # Trigger Devin and wait for unit tests to be fixed
119
- devin sessions create "Fix the failing authentication tests"
120
- echo "Devin finished. Running integration tests..."
121
- npm test
122
- ```
123
-
124
- **Audit Subsystem Costs:**
125
- ```bash
126
- # Get ACU consumption for a specific incident
127
- devin sessions cost --id <SESSION_ID>
128
- ```
162
+ | Flag | Description |
163
+ | :--- | :--- |
164
+ | `--profile <name>` | Select a named configuration profile |
165
+ | `--org <id>` | Override the active organization for a single command |
166
+ | `--json` | Output raw JSON (available on `sessions list`, `repos list`, `secrets list`) |
167
+ | `--force` | Skip duplicate session detection and create anyway |
168
+ | `--advanced-mode` | Request an advanced mode session requiring browser auth |
129
169
 
130
170
  ---
131
171
 
132
- ## 📟 Integration & Environment Variables
172
+ ## 🛡 Session Deduplication
173
+
174
+ The CLI caches a SHA-256 hash of your last 50 prompts per profile. If you attempt to launch a session with an identical prompt, the CLI halts and alerts you before wasting ACUs:
175
+
176
+ ```
177
+ Duplicate Detected: You recently created a session with this exact prompt.
178
+ Existing Session ID: abc123...
179
+ Are you sure you want to create a duplicate session? [y/N]
180
+ ```
133
181
 
134
- Devin CLI is designed for CI/CD. Use environment variables to bypass the `configure` step entirely.
182
+ Use `--force` to bypass this check.
135
183
 
136
- - `DEVIN_API_TOKEN`: Your API token.
137
- - `DEVIN_ORG_ID`: Your target organization ID.
138
- - `DEVIN_BASE_URL`: (Optional) Overrides the standard `https://api.devin.ai/v3`.
184
+ ---
185
+
186
+ ## 📟 CI/CD Integration
139
187
 
140
188
  ```yaml
141
189
  # Example GitHub Action Step
@@ -146,25 +194,38 @@ run: |
146
194
  devin sessions create "Review PR #${{ github.event.pull_request.number }}"
147
195
  ```
148
196
 
197
+ **Supported environment variables:**
198
+
199
+ | Variable | Description |
200
+ | :--- | :--- |
201
+ | `DEVIN_API_TOKEN` | Your API token (overrides config file) |
202
+ | `DEVIN_ORG_ID` | Your organization ID |
203
+ | `DEVIN_BASE_URL` | Override the default base URL |
204
+ | `DEVIN_API_VERSION` | Set `v1` or `v3` without configuring |
205
+
149
206
  ---
150
207
 
151
208
  ## ⚙️ Engineering Specs
152
- - **Architecture**: Complete Devin API `v3` Support (including `v3beta1` and `enterprise` endpoints).
209
+
210
+ - **Architecture**: Full v3 API support (including `v3beta1` and `enterprise` endpoints) + v1 legacy proxy
153
211
  - **Config Storage**: `~/.config/devin/config.json`
154
212
  - **Platform Support**: Linux, macOS, WSL2
213
+ - **Python**: 3.9+
155
214
 
156
215
  ---
157
216
 
158
217
  ## 🧪 Developer Hub
218
+
159
219
  ```bash
160
220
  # Setup
161
221
  pip install -e ".[dev]"
162
222
 
163
- # Test Suite (100% path coverage)
223
+ # Test Suite
164
224
  PYTHONPATH=src python3 -m pytest
165
225
  ```
166
226
 
167
227
  ---
168
228
 
169
229
  ## 📄 License
230
+
170
231
  MIT. **Devin CLI** is an unofficial community project and is not affiliated with Cognition AI.
@@ -0,0 +1,195 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/revanthpobala/devin-cli/main/assets/logo.png" alt="Devin CLI Logo" width="300">
3
+ </p>
4
+
5
+ # Devin CLI (Unofficial) — The Professional Terminal Interface for Devin AI
6
+
7
+ <p align="center">
8
+ <a href="https://pypi.org/project/devin-cli/"><img src="https://img.shields.io/pypi/v/devin-cli.svg?style=for-the-badge&color=0294DE" alt="PyPI version"></a>
9
+ <a href="https://github.com/revanthpobala/homebrew-tap"><img src="https://img.shields.io/badge/Homebrew-Tap-orange?style=for-the-badge&logo=homebrew" alt="Homebrew Tap"></a>
10
+ <a href="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml"><img src="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml/badge.svg" alt="Build Status"></a>
11
+ </p>
12
+
13
+ > **The first unofficial CLI for the world's first AI Software Engineer. Supports both the modern v3 API and the legacy v1 API with full multi-profile management.**
14
+
15
+ Devin CLI is designed for high-velocity engineering teams. It strips away the friction of the web UI, allowing you to orchestrate autonomous agents, manage complex contexts, and automate multi-step development workflows through a robust, terminal-first interface.
16
+
17
+ ---
18
+
19
+ ## ⚡ Quick Start
20
+
21
+ ### 1. Installation
22
+
23
+ **Recommended: Via Homebrew (macOS)**
24
+ ```bash
25
+ brew tap revanthpobala/tap
26
+ brew install devin-cli
27
+ ```
28
+
29
+ **Via pipx (Isolated environment)**
30
+ ```bash
31
+ pipx install devin-cli
32
+ ```
33
+
34
+ **Via pip**
35
+ ```bash
36
+ pip install devin-cli
37
+ ```
38
+
39
+ ### 2. Configuration
40
+ ```bash
41
+ devin configure
42
+ # Paste your API token (apk_... or cog_...) from https://preview.devin.ai/settings
43
+ # Select API version: v3 (default) or v1 (legacy)
44
+ ```
45
+
46
+ ### 3. Your First Session
47
+ ```bash
48
+ devin sessions create "Identify and fix the race condition in our Redis cache layer"
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 🔑 Multi-Profile Support
54
+
55
+ The CLI supports multiple named profiles, letting you manage separate tokens, organizations, and API versions from a single install.
56
+
57
+ ```bash
58
+ # Configure your personal v3 profile
59
+ devin configure --profile personal
60
+
61
+ # Configure a service account profile
62
+ devin configure --profile service
63
+
64
+ # Switch profiles at runtime
65
+ devin --profile service sessions list
66
+ devin --profile personal sessions create "Fix the failing tests"
67
+ ```
68
+
69
+ Profiles are stored in `~/.config/devin/config.json` and are fully isolated — including their session deduplication caches and active session IDs.
70
+
71
+ ---
72
+
73
+ ## 🕹 Legacy v1 API Support
74
+
75
+ If you are running an older integration against the original Devin API v1 endpoints, the CLI acts as a transparent proxy and routes calls to the correct v1 URLs without breaking your v3 integrations.
76
+
77
+ **To configure a v1 profile:**
78
+ ```bash
79
+ devin configure --profile legacy
80
+ # When prompted for API Version, enter: v1
81
+ # Set Base URL to: https://api.devin.ai/v1
82
+ ```
83
+
84
+ **To use the v1 profile:**
85
+ ```bash
86
+ devin --profile legacy sessions create "Run the migration script"
87
+ devin --profile legacy sessions list
88
+ ```
89
+
90
+ **What works in v1:**
91
+
92
+ | Feature | v1 | v3 |
93
+ | :--- | :---: | :---: |
94
+ | Sessions (create, list, get, terminate) | ✅ | ✅ |
95
+ | Knowledge (create, update, delete) | ✅ | ✅ |
96
+ | Playbooks (create, update, delete) | ✅ | ✅ |
97
+ | Secrets (list, create, delete) | ✅ | ✅ |
98
+ | Attachments (upload, download) | ✅ | ✅ |
99
+ | Session Insights | ❌ | ✅ |
100
+ | Schedules | ❌ | ✅ |
101
+ | Repositories | ❌ | ✅ |
102
+ | Enterprise endpoints | ❌ | ✅ |
103
+
104
+ > The help menu will show `(Legacy v1 API)` and `(v3 Only)` tags next to commands when a v1 profile is active.
105
+
106
+ ---
107
+
108
+ ## 🛠 Command Reference
109
+
110
+ Every sub-command supports the `--org` flag to override your active organization on the fly.
111
+
112
+ | Category | Commands | Description |
113
+ | :--- | :--- | :--- |
114
+ | **Sessions** | `create`, `list`, `get`, `insights`, `cost`, `messages`, `message`, `terminate` | Core agent lifecycle and analytics. |
115
+ | **Knowledge** | `list`, `create`, `delete` | Manage organizational context and AI memory. |
116
+ | **Playbooks** | `list`, `create`, `update`, `delete` | Automate complex, multi-step agent workflows. |
117
+ | **Secrets** | `list`, `create`, `delete` | Pass API keys and credentials to Devin sessions. |
118
+ | **Schedules** | `list`, `create` | Schedule recurring autonomous tasks via CRON. |
119
+ | **Repositories** | `list`, `index` | Force indexing of Git repositories for Devin context. |
120
+ | **Attachments** | `upload`, `download` | Transfer context files seamlessly. |
121
+ | **Enterprise** | `whoami`, `list-orgs` | Administrative identity discovery. |
122
+ | **Global** | `configure`, `use` | CLI setup and active session management. |
123
+
124
+ ### Key Flags
125
+
126
+ | Flag | Description |
127
+ | :--- | :--- |
128
+ | `--profile <name>` | Select a named configuration profile |
129
+ | `--org <id>` | Override the active organization for a single command |
130
+ | `--json` | Output raw JSON (available on `sessions list`, `repos list`, `secrets list`) |
131
+ | `--force` | Skip duplicate session detection and create anyway |
132
+ | `--advanced-mode` | Request an advanced mode session requiring browser auth |
133
+
134
+ ---
135
+
136
+ ## 🛡 Session Deduplication
137
+
138
+ The CLI caches a SHA-256 hash of your last 50 prompts per profile. If you attempt to launch a session with an identical prompt, the CLI halts and alerts you before wasting ACUs:
139
+
140
+ ```
141
+ Duplicate Detected: You recently created a session with this exact prompt.
142
+ Existing Session ID: abc123...
143
+ Are you sure you want to create a duplicate session? [y/N]
144
+ ```
145
+
146
+ Use `--force` to bypass this check.
147
+
148
+ ---
149
+
150
+ ## 📟 CI/CD Integration
151
+
152
+ ```yaml
153
+ # Example GitHub Action Step
154
+ env:
155
+ DEVIN_API_TOKEN: ${{ secrets.DEVIN_API_TOKEN }}
156
+ DEVIN_ORG_ID: ${{ secrets.DEVIN_ORG_ID }}
157
+ run: |
158
+ devin sessions create "Review PR #${{ github.event.pull_request.number }}"
159
+ ```
160
+
161
+ **Supported environment variables:**
162
+
163
+ | Variable | Description |
164
+ | :--- | :--- |
165
+ | `DEVIN_API_TOKEN` | Your API token (overrides config file) |
166
+ | `DEVIN_ORG_ID` | Your organization ID |
167
+ | `DEVIN_BASE_URL` | Override the default base URL |
168
+ | `DEVIN_API_VERSION` | Set `v1` or `v3` without configuring |
169
+
170
+ ---
171
+
172
+ ## ⚙️ Engineering Specs
173
+
174
+ - **Architecture**: Full v3 API support (including `v3beta1` and `enterprise` endpoints) + v1 legacy proxy
175
+ - **Config Storage**: `~/.config/devin/config.json`
176
+ - **Platform Support**: Linux, macOS, WSL2
177
+ - **Python**: 3.9+
178
+
179
+ ---
180
+
181
+ ## 🧪 Developer Hub
182
+
183
+ ```bash
184
+ # Setup
185
+ pip install -e ".[dev]"
186
+
187
+ # Test Suite
188
+ PYTHONPATH=src python3 -m pytest
189
+ ```
190
+
191
+ ---
192
+
193
+ ## 📄 License
194
+
195
+ MIT. **Devin CLI** is an unofficial community project and is not affiliated with Cognition AI.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "devin-cli"
3
- version = "1.1.2"
3
+ version = "1.1.4"
4
4
  description = "Unofficial CLI for Devin AI - The first AI Software Engineer"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -80,7 +80,6 @@ class BaseClient:
80
80
  except ValueError:
81
81
  return response.text
82
82
 
83
- # If it's not JSON, it might be an attachment or raw text
84
83
  if any(t in content_type for t in ["image/", "application/octet-stream", "application/pdf"]):
85
84
  return response.content
86
85
 
@@ -93,12 +92,10 @@ class BaseClient:
93
92
  self._ensure_token()
94
93
  url = self._format_url(endpoint)
95
94
 
96
- # Merge headers if needed, but usually self.headers is enough
97
95
  headers = self.headers.copy()
98
96
  if "headers" in kwargs:
99
97
  headers.update(kwargs.pop("headers"))
100
98
 
101
- # Handle file uploads (remove Content-Type)
102
99
  if "files" in kwargs:
103
100
  headers.pop("Content-Type", None)
104
101
 
@@ -18,8 +18,6 @@ def create_knowledge(
18
18
  "body": body,
19
19
  "trigger_description": trigger_description or ""
20
20
  }
21
- if macro:
22
- data["macro"] = macro
23
21
  if parent_folder_id:
24
22
  data["parent_folder_id"] = parent_folder_id
25
23
  if pinned_repo:
@@ -129,7 +129,6 @@ def configure(
129
129
  if profile:
130
130
  config.active_profile = profile
131
131
 
132
- # Validation based on v3 requirements
133
132
  if not (token.startswith("apk_") or token.startswith("cog_")):
134
133
  console.print("[bold yellow]Warning:[/bold yellow] Token format might be outdated. v3 tokens usually start with 'apk_' or 'cog_'.")
135
134
 
@@ -175,7 +174,6 @@ def create_session_cmd(
175
174
  if existing_sid and not force:
176
175
  console.print(f"[bold yellow]Duplicate Detected:[/bold yellow] You recently created a session with this exact prompt.")
177
176
  console.print(f"Existing Session ID: [bold cyan]{existing_sid}[/bold cyan]")
178
- import typer
179
177
  if not typer.confirm("Are you sure you want to create a duplicate session?"):
180
178
  console.print("Session creation cancelled. Use the existing session ID above to resume.")
181
179
  raise typer.Exit()
@@ -192,9 +190,8 @@ def create_session_cmd(
192
190
  if "advanced_mode_url" in resp:
193
191
  adv_url = resp["advanced_mode_url"]
194
192
  console.print(f"[bold yellow]Advanced Mode Authorization Required![/bold yellow]")
195
- console.print(f"Please complete verify the advanced mode setup in your browser:")
193
+ console.print(f"Please complete the advanced mode setup in your browser:")
196
194
  console.print(f"[bold cyan]{adv_url}[/bold cyan]")
197
- import typer
198
195
  if typer.confirm("Open browser now?"):
199
196
  import webbrowser
200
197
  webbrowser.open(adv_url)
@@ -255,7 +252,11 @@ def session_insights_cmd(
255
252
  if org: config.temporary_org_id = org
256
253
  sid = session_id or get_current_session_id()
257
254
  resp = sessions.get_session_insights(sid)
258
- console.print(Panel(json.dumps(resp, indent=2), title=f"Insights for {sid}"))
255
+ if isinstance(resp, dict) and "error" in resp:
256
+ console.print(f"[bold yellow]Note:[/bold yellow] {resp['error']}")
257
+ console.print("Tip: Switch to v3 with [bold cyan]devin configure[/bold cyan] or use [bold cyan]--profile [v3-profile][/bold cyan]")
258
+ else:
259
+ console.print(Panel(json.dumps(resp, indent=2), title=f"Insights for {sid}"))
259
260
 
260
261
  @session_app.command("cost")
261
262
  @handle_api_error
@@ -266,10 +267,12 @@ def session_cost_cmd(
266
267
  """View ACU consumption."""
267
268
  if org: config.temporary_org_id = org
268
269
  if session_id:
269
- resp = consumption.get_session_consumption(session_id)
270
+ resp = sessions.get_session(session_id)
271
+ cost_data = {"session_id": resp.get("session_id"), "status": resp.get("status_enum"), "acu_used": resp.get("acu_used")}
272
+ console.print(Panel(json.dumps(cost_data, indent=2), title=f"Session Cost: {session_id}"))
270
273
  else:
271
274
  resp = consumption.get_daily_consumption_breakdown()
272
- console.print(Panel(json.dumps(resp, indent=2), title="Consumption Data"))
275
+ console.print(Panel(json.dumps(resp, indent=2), title="Daily Consumption"))
273
276
 
274
277
  @session_app.command("message")
275
278
  @handle_api_error
@@ -382,7 +385,6 @@ def update_playbook_cmd(
382
385
  body_bytes = len(body.encode('utf-8')) if body else 0
383
386
  if body_bytes > 500 * 1024:
384
387
  console.print(f"[bold yellow]Warning:[/bold yellow] Playbook body is {body_bytes / 1024:.1f}KB. Devin API may reject payloads > 500KB.")
385
- import typer
386
388
  if not typer.confirm("Attempt to send anyway?"):
387
389
  raise typer.Exit()
388
390
 
@@ -402,7 +404,6 @@ def create_playbook_cmd(
402
404
  body_bytes = len(body.encode('utf-8')) if body else 0
403
405
  if body_bytes > 500 * 1024:
404
406
  console.print(f"[bold yellow]Warning:[/bold yellow] Playbook body is {body_bytes / 1024:.1f}KB. Devin API may reject payloads > 500KB.")
405
- import typer
406
407
  if not typer.confirm("Attempt to send anyway?"):
407
408
  raise typer.Exit()
408
409
 
@@ -425,15 +426,29 @@ def delete_playbook_cmd(
425
426
  # --- Secrets ---
426
427
  @secret_app.command("list")
427
428
  @handle_api_error
428
- def list_secrets_cmd(org: Optional[str] = typer.Option(None, "--org")):
429
+ def list_secrets_cmd(
430
+ org: Optional[str] = typer.Option(None, "--org"),
431
+ json_output: bool = typer.Option(False, "--json"),
432
+ ):
429
433
  """List organization secrets."""
430
434
  if org: config.temporary_org_id = org
431
435
  resp = secrets.list_secrets()
436
+ if isinstance(resp, dict):
437
+ items = resp.get("secrets", resp.get("items", []))
438
+ elif isinstance(resp, list):
439
+ items = resp
440
+ else:
441
+ console.print(f"[yellow]Unexpected response format: {type(resp).__name__}[/yellow]")
442
+ items = []
443
+ if json_output:
444
+ console.print(json.dumps(items, indent=2))
445
+ return
432
446
  table = Table(title="Secrets")
433
447
  table.add_column("ID", style="cyan")
434
448
  table.add_column("Name")
435
- for item in resp:
436
- table.add_row(item.get("id"), item.get("name"))
449
+ for item in items:
450
+ if isinstance(item, dict):
451
+ table.add_row(item.get("id"), item.get("name"))
437
452
  console.print(table)
438
453
 
439
454
  @secret_app.command("delete")
@@ -492,16 +507,23 @@ def create_schedule_cmd(
492
507
  # --- Repositories ---
493
508
  @repo_app.command("list")
494
509
  @handle_api_error
495
- def list_repos_cmd(org: Optional[str] = typer.Option(None, "--org")):
510
+ def list_repos_cmd(
511
+ org: Optional[str] = typer.Option(None, "--org"),
512
+ json_output: bool = typer.Option(False, "--json"),
513
+ ):
496
514
  """List repositories indexed for Devin."""
497
515
  if org: config.temporary_org_id = org
498
516
  resp = repositories.list_repositories()
499
- items = resp.get("items", [])
517
+ items = resp.get("repositories", resp.get("items", []))
518
+ if json_output:
519
+ console.print(json.dumps(items, indent=2))
520
+ return
500
521
  table = Table(title="Repositories")
501
522
  table.add_column("Path", style="cyan")
502
523
  table.add_column("Indexed", style="green")
503
524
  for item in items:
504
- table.add_row(item.get("repository_path"), "Yes" if item.get("is_indexed") else "No")
525
+ path = item.get("repository_path") or item.get("path") or item.get("name", "")
526
+ table.add_row(path, "Yes" if item.get("is_indexed") else "No")
505
527
  console.print(table)
506
528
 
507
529
  @repo_app.command("index")
@@ -7,7 +7,7 @@ runner = CliRunner()
7
7
  def test_app_help():
8
8
  result = runner.invoke(app, ["--help"])
9
9
  assert result.exit_code == 0
10
- assert "Unofficial CLI for Devin AI v3" in result.stdout
10
+ assert "Unofficial CLI for Devin AI" in result.stdout
11
11
 
12
12
  def test_app_configure_help():
13
13
  result = runner.invoke(app, ["configure", "--help"])
devin_cli-1.1.2/README.md DELETED
@@ -1,134 +0,0 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/revanthpobala/devin-cli/main/assets/logo.png" alt="Devin CLI Logo" width="300">
3
- </p>
4
-
5
- # Devin CLI (Unofficial) — The Professional Terminal Interface for Devin AI
6
-
7
- <p align="center">
8
- <a href="https://pypi.org/project/devin-cli/"><img src="https://img.shields.io/pypi/v/devin-cli.svg?style=for-the-badge&color=0294DE" alt="PyPI version"></a>
9
- <a href="https://github.com/revanthpobala/homebrew-tap"><img src="https://img.shields.io/badge/Homebrew-Tap-orange?style=for-the-badge&logo=homebrew" alt="Homebrew Tap"></a>
10
- <a href="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml"><img src="https://github.com/revanthpobala/devin-cli/actions/workflows/pypi-publish.yml/badge.svg" alt="Build Status"></a>
11
- </p>
12
-
13
- > **The first unofficial CLI for the world's first AI Software Engineer. Now upgraded to v1.1.0 with Multi-Profile support and legacy v1 backward-compatibility.**
14
-
15
- Devin CLI is designed for high-velocity engineering teams. It strips away the friction of the web UI, allowing you to orchestrate autonomous agents, manage complex contexts, and automate multi-step development workflows through a robust, terminal-first interface. Built for performance, SEO, and developer productivity.
16
-
17
- ---
18
-
19
- ## ⚡ Quick Start
20
-
21
- ### 1. Installation
22
-
23
- **Recommended: Via Homebrew (macOS)**
24
- ```bash
25
- brew tap revanthpobala/tap
26
- brew install devin-cli
27
- ```
28
-
29
- **Via pipx (Isolated environment)**
30
- ```bash
31
- pipx install devin-cli
32
- ```
33
-
34
- **Via pip**
35
- ```bash
36
- pip install devin-cli
37
- ```
38
-
39
- ### 2. Configuration
40
- ```bash
41
- devin configure
42
- # Paste your v3 API token (apk_... or cog_...) from https://preview.devin.ai/settings
43
- # Optionally configure your Organization ID here.
44
- ```
45
-
46
- ### 3. Your First Session
47
- ```bash
48
- devin sessions create -t "Identify and fix the race condition in our Redis cache layer"
49
- ```
50
-
51
- ## 🌟 What's New in v1.1.0
52
-
53
- - **Dual-Token Profiles:** Seamlessly switch between personal (`apk_user_`) and Service Account (`cog_`) tokens on the fly using `--profile`.
54
- - `devin configure --profile service`
55
- - `devin --profile service sessions list`
56
- - **Legacy v1 Backward Compatibility:** Need to run an older integration that depends on the original Devin API shapes? The CLI now acts as a dynamic proxy. Simply configure a profile to use `api_version: v1`, and the CLI will route authentic payloads directly to the deprecated v1 endpoints without breaking your v3 integrations.
57
- - **Session Deduplication (Anti-Spam):** Avoid burning ACUs on accidental retries. The CLI now actively caches a SHA-256 hash of your last 50 prompts per profile, immediately halting and alerting you if you attempt to launch a duplicate session.
58
- - **Advanced Mode Auth:** Automatically traps `advanced_mode_url` requirements and securely prompts you to finish the connection handshake directly in your web browser.
59
-
60
- ---
61
-
62
- ## 🛠 Command Cheat Sheet (v3 Architecture)
63
-
64
- The v3 architecture introduces a modular, hierarchical CLI structure focusing on enterprise features, secrets, and organizational management. Every sub-command supports the `--org` flag to override your active organization on the fly.
65
-
66
- | Category | Commands | Description |
67
- | :--- | :--- | :--- |
68
- | **Sessions** | `create`, `list`, `get`, `insights`, `cost`, `messages`, `message`, `terminate` | Core agent lifecycle and analytics. |
69
- | **Knowledge** | `list`, `create`, `delete` | Manage organizational context and AI memory. |
70
- | **Playbooks** | `list`, `create`, `delete` | Automate complex, multi-step agent workflows. |
71
- | **Secrets** | `list`, `create`, `delete` | Manage API keys passing to Devin sessions. |
72
- | **Schedules** | `list`, `create` | Schedule recurring autonomous tasks via CRON. |
73
- | **Repositories** | `list`, `index` | Force indexing of Git repositories. |
74
- | **Attachments** | `upload`, `download` | Transfer context files seamlessly. |
75
- | **Enterprise** | `whoami`, `list-orgs` | Administrative identity discovery. |
76
- | **Global** | `configure`, `use` | CLI setup and active session swapping. |
77
-
78
- ### Example Automations
79
-
80
- **Blocking Call for CI/CD:**
81
- ```bash
82
- # Trigger Devin and wait for unit tests to be fixed
83
- devin sessions create "Fix the failing authentication tests"
84
- echo "Devin finished. Running integration tests..."
85
- npm test
86
- ```
87
-
88
- **Audit Subsystem Costs:**
89
- ```bash
90
- # Get ACU consumption for a specific incident
91
- devin sessions cost --id <SESSION_ID>
92
- ```
93
-
94
- ---
95
-
96
- ## 📟 Integration & Environment Variables
97
-
98
- Devin CLI is designed for CI/CD. Use environment variables to bypass the `configure` step entirely.
99
-
100
- - `DEVIN_API_TOKEN`: Your API token.
101
- - `DEVIN_ORG_ID`: Your target organization ID.
102
- - `DEVIN_BASE_URL`: (Optional) Overrides the standard `https://api.devin.ai/v3`.
103
-
104
- ```yaml
105
- # Example GitHub Action Step
106
- env:
107
- DEVIN_API_TOKEN: ${{ secrets.DEVIN_API_TOKEN }}
108
- DEVIN_ORG_ID: ${{ secrets.DEVIN_ORG_ID }}
109
- run: |
110
- devin sessions create "Review PR #${{ github.event.pull_request.number }}"
111
- ```
112
-
113
- ---
114
-
115
- ## ⚙️ Engineering Specs
116
- - **Architecture**: Complete Devin API `v3` Support (including `v3beta1` and `enterprise` endpoints).
117
- - **Config Storage**: `~/.config/devin/config.json`
118
- - **Platform Support**: Linux, macOS, WSL2
119
-
120
- ---
121
-
122
- ## 🧪 Developer Hub
123
- ```bash
124
- # Setup
125
- pip install -e ".[dev]"
126
-
127
- # Test Suite (100% path coverage)
128
- PYTHONPATH=src python3 -m pytest
129
- ```
130
-
131
- ---
132
-
133
- ## 📄 License
134
- MIT. **Devin CLI** is an unofficial community project and is not affiliated with Cognition AI.
@@ -1,19 +0,0 @@
1
- import logging
2
- import httpx
3
- from devin_cli.api import sessions
4
- from devin_cli.config import config
5
- import json
6
-
7
- logging.basicConfig(level=logging.DEBUG)
8
- logging.getLogger("httpx").setLevel(logging.DEBUG)
9
-
10
- print("Active Token:", config.api_token[:10] if config.api_token else "None")
11
- print("Base URL:", config.base_url)
12
-
13
- try:
14
- print("Sending request...")
15
- resp = sessions.create_session(prompt="Testing duplicate bug. Ignore.", title="Duplicate Test")
16
- print("Response:")
17
- print(json.dumps(resp, indent=2))
18
- except Exception as e:
19
- print("Error:", e)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes