codicent-cli 0.4.6__tar.gz → 0.4.7__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.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Johan Isaksson
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Johan Isaksson
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codicent-cli
3
- Version: 0.4.6
3
+ Version: 0.4.7
4
4
  Summary: Command-line interface for the Codicent API
5
5
  Home-page: https://github.com/izaxon/codicent-cli
6
6
  Author: Johan Isaksson
@@ -26,6 +26,7 @@ License-File: LICENSE
26
26
  Requires-Dist: rich
27
27
  Requires-Dist: codicent-py
28
28
  Requires-Dist: prompt_toolkit
29
+ Requires-Dist: requests
29
30
  Dynamic: author
30
31
  Dynamic: author-email
31
32
  Dynamic: classifier
@@ -91,7 +92,7 @@ You can also install directly from GitHub:
91
92
  pip install git+https://github.com/izaxon/codicent-cli.git
92
93
 
93
94
  # Install a specific version
94
- pip install git+https://github.com/izaxon/codicent-cli.git@v0.4.6
95
+ pip install git+https://github.com/izaxon/codicent-cli.git@v0.4.7
95
96
  ```
96
97
 
97
98
  ## Usage
@@ -1,217 +1,217 @@
1
- # Codicent CLI
2
-
3
- Codicent CLI is a command-line interface for interacting with the Codicent API. It provides both one-shot command execution and interactive chat sessions with comprehensive error handling and user-friendly features.
4
-
5
- ## Features
6
-
7
- - **One-shot mode**: Execute single commands and get responses
8
- - **Interactive mode**: Continuous chat sessions with conversation tracking
9
- - **Message types**: Support for regular chat and @-prefixed info messages
10
- - **Input flexibility**: Command arguments, stdin pipes, or interactive prompts
11
- - **Rich output**: Markdown-formatted responses with beautiful terminal UI
12
- - **Error handling**: Comprehensive error messages and graceful failure handling
13
- - **Logging**: Configurable logging levels for debugging
14
-
15
- ## Installation
16
-
17
- ### Prerequisites
18
-
19
- - Python 3.6 or higher
20
- - `pip` (Python package installer)
21
-
22
- ### Quick Installation
23
-
24
- ```bash
25
- # Install from PyPI
26
- pip install codicent-py codicent-cli
27
- ```
28
-
29
- ### Development Installation
30
-
31
- #### Steps
32
-
33
- 1. Clone the repository:
34
- ```bash
35
- git clone https://github.com/izaxon/codicent-cli.git
36
- cd codicent-cli
37
- ```
38
-
39
- 2. Install in development mode:
40
- ```bash
41
- pip install -e .
42
- ```
43
-
44
- ### Direct Installation from GitHub
45
-
46
- You can also install directly from GitHub:
47
-
48
- ```bash
49
- # Install the latest version
50
- pip install git+https://github.com/izaxon/codicent-cli.git
51
-
52
- # Install a specific version
53
- pip install git+https://github.com/izaxon/codicent-cli.git@v0.4.6
54
- ```
55
-
56
- ## Usage
57
-
58
- ### Basic Setup
59
-
60
- 1. Set the `CODICENT_TOKEN` environment variable with your Codicent API token:
61
- ```bash
62
- export CODICENT_TOKEN="YOUR_API_TOKEN"
63
- ```
64
-
65
- ### Command Options
66
-
67
- ```
68
- codicent [OPTIONS] [QUESTION]
69
-
70
- OPTIONS:
71
- -t, --interactive Start interactive chat mode
72
- -h, --help Show help message
73
- -v, --version Show version information
74
- --verbose Enable verbose logging
75
- --quiet Suppress non-essential output
76
- ```
77
-
78
- ### Examples
79
-
80
- **One-shot questions:**
81
- ```bash
82
- codicent "What can you help me with?"
83
- codicent "Explain Python decorators"
84
- ```
85
-
86
- **Interactive mode:**
87
- ```bash
88
- codicent -t
89
- # or
90
- codicent --interactive
91
- ```
92
-
93
- **Piped input:**
94
- ```bash
95
- echo "What is machine learning?" | codicent
96
- codicent < questions.txt
97
- cat code.py | codicent "Review this code"
98
- ```
99
-
100
- **Info messages (@ prefix):**
101
- ```bash
102
- codicent "@mention This is an info message"
103
- ```
104
-
105
- **With logging:**
106
- ```bash
107
- codicent --verbose "Debug this issue"
108
- codicent --quiet "Silent operation"
109
- ```
110
-
111
- ## Interactive Mode
112
-
113
- In interactive mode, you can have ongoing conversations with enhanced visual clarity:
114
-
115
- ```
116
- $ codicent -t
117
- 🤖 Codicent CLI Interactive Mode
118
- Type your questions or use Ctrl+C to exit.
119
- Prefix with @ for info messages.
120
- ──────────────────────────────────────────────────
121
- ¤ What is Python?
122
-
123
- Python is a high-level, interpreted programming language known for its
124
- simplicity and readability. It was created by Guido van Rossum and first
125
- released in 1991.
126
-
127
- Key features:
128
- • Easy to learn and use
129
- • Extensive standard library
130
- • Cross-platform compatibility
131
- • Strong community support
132
- ──────────────────────────────────────────────────
133
- ¤ Can you give me an example?
134
-
135
- Here's a simple Python example:
136
-
137
- # Hello World in Python
138
- print("Hello, World!")
139
-
140
- # Working with variables
141
- name = "Alice"
142
- age = 25
143
- print(f"My name is {name} and I am {age} years old.")
144
-
145
- Python's syntax is clean and intuitive!
146
- ──────────────────────────────────────────────────
147
- ¤ @mention Save this conversation
148
- ✅ Message posted successfully.
149
- ──────────────────────────────────────────────────
150
- ¤ ^C
151
- 👋 Goodbye!
152
- ```
153
-
154
- **Visual Features:**
155
- - **Colored messages**: User input appears in cyan, bot responses in green
156
- - **Clean prompting**: Original `¤` prompt character maintained
157
- - **Visual separators**: Clear lines between conversations
158
- - **Rich formatting**: Markdown responses with syntax highlighting
159
- - **Status indicators**: Animated thinking indicators and success messages
160
- - **Emojis**: Friendly visual cues throughout the interface
161
-
162
- ## Error Handling
163
-
164
- The CLI provides helpful error messages for common issues:
165
-
166
- - **Missing token**: Clear instructions on setting up `CODICENT_TOKEN`
167
- - **Network errors**: Graceful handling of connection issues
168
- - **API errors**: Detailed error messages from the Codicent API
169
- - **Input validation**: Prevents empty or overly long inputs
170
- - **Keyboard interrupts**: Clean exit handling
171
-
172
- ## Development
173
-
174
- ### Running Tests
175
-
176
- ```bash
177
- python -m pytest test_app.py -v
178
- ```
179
-
180
- ### Project Structure
181
-
182
- - `app.py` - Main application logic (single-file architecture)
183
- - `test_app.py` - Comprehensive test suite
184
- - `setup.py` - Package configuration
185
- - `requirements.txt` - Dependencies (now uses PyPI packages)
186
-
187
- ### Dependencies
188
-
189
- - **codicent-py**: Core API client for Codicent services (now available on PyPI)
190
- - **rich**: Terminal formatting, markdown rendering, and animations
191
-
192
- ## Troubleshooting
193
-
194
- ### Common Issues
195
-
196
- 1. **"CODICENT_TOKEN environment variable is not set"**
197
- - Set the token: `export CODICENT_TOKEN="your_token"`
198
- - Verify it's set: `echo $CODICENT_TOKEN`
199
-
200
- 2. **"Network error: Unable to connect to Codicent API"**
201
- - Check your internet connection
202
- - Verify the Codicent API is accessible
203
- - Try again with `--verbose` for more details
204
-
205
- 3. **"Failed to initialize Codicent API client"**
206
- - Verify your token is valid
207
- - Check if the codicent-py package is properly installed
208
-
209
- ### Getting Help
210
-
211
- - Use `codicent --help` for usage information
212
- - Use `codicent --verbose` for detailed logging
213
- - Check the [Codicent documentation](https://github.com/izaxon/codicent-py) for API details
214
-
215
- ## License
216
-
217
- This project is licensed under the MIT License.
1
+ # Codicent CLI
2
+
3
+ Codicent CLI is a command-line interface for interacting with the Codicent API. It provides both one-shot command execution and interactive chat sessions with comprehensive error handling and user-friendly features.
4
+
5
+ ## Features
6
+
7
+ - **One-shot mode**: Execute single commands and get responses
8
+ - **Interactive mode**: Continuous chat sessions with conversation tracking
9
+ - **Message types**: Support for regular chat and @-prefixed info messages
10
+ - **Input flexibility**: Command arguments, stdin pipes, or interactive prompts
11
+ - **Rich output**: Markdown-formatted responses with beautiful terminal UI
12
+ - **Error handling**: Comprehensive error messages and graceful failure handling
13
+ - **Logging**: Configurable logging levels for debugging
14
+
15
+ ## Installation
16
+
17
+ ### Prerequisites
18
+
19
+ - Python 3.6 or higher
20
+ - `pip` (Python package installer)
21
+
22
+ ### Quick Installation
23
+
24
+ ```bash
25
+ # Install from PyPI
26
+ pip install codicent-py codicent-cli
27
+ ```
28
+
29
+ ### Development Installation
30
+
31
+ #### Steps
32
+
33
+ 1. Clone the repository:
34
+ ```bash
35
+ git clone https://github.com/izaxon/codicent-cli.git
36
+ cd codicent-cli
37
+ ```
38
+
39
+ 2. Install in development mode:
40
+ ```bash
41
+ pip install -e .
42
+ ```
43
+
44
+ ### Direct Installation from GitHub
45
+
46
+ You can also install directly from GitHub:
47
+
48
+ ```bash
49
+ # Install the latest version
50
+ pip install git+https://github.com/izaxon/codicent-cli.git
51
+
52
+ # Install a specific version
53
+ pip install git+https://github.com/izaxon/codicent-cli.git@v0.4.7
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ ### Basic Setup
59
+
60
+ 1. Set the `CODICENT_TOKEN` environment variable with your Codicent API token:
61
+ ```bash
62
+ export CODICENT_TOKEN="YOUR_API_TOKEN"
63
+ ```
64
+
65
+ ### Command Options
66
+
67
+ ```
68
+ codicent [OPTIONS] [QUESTION]
69
+
70
+ OPTIONS:
71
+ -t, --interactive Start interactive chat mode
72
+ -h, --help Show help message
73
+ -v, --version Show version information
74
+ --verbose Enable verbose logging
75
+ --quiet Suppress non-essential output
76
+ ```
77
+
78
+ ### Examples
79
+
80
+ **One-shot questions:**
81
+ ```bash
82
+ codicent "What can you help me with?"
83
+ codicent "Explain Python decorators"
84
+ ```
85
+
86
+ **Interactive mode:**
87
+ ```bash
88
+ codicent -t
89
+ # or
90
+ codicent --interactive
91
+ ```
92
+
93
+ **Piped input:**
94
+ ```bash
95
+ echo "What is machine learning?" | codicent
96
+ codicent < questions.txt
97
+ cat code.py | codicent "Review this code"
98
+ ```
99
+
100
+ **Info messages (@ prefix):**
101
+ ```bash
102
+ codicent "@mention This is an info message"
103
+ ```
104
+
105
+ **With logging:**
106
+ ```bash
107
+ codicent --verbose "Debug this issue"
108
+ codicent --quiet "Silent operation"
109
+ ```
110
+
111
+ ## Interactive Mode
112
+
113
+ In interactive mode, you can have ongoing conversations with enhanced visual clarity:
114
+
115
+ ```
116
+ $ codicent -t
117
+ 🤖 Codicent CLI Interactive Mode
118
+ Type your questions or use Ctrl+C to exit.
119
+ Prefix with @ for info messages.
120
+ ──────────────────────────────────────────────────
121
+ ¤ What is Python?
122
+
123
+ Python is a high-level, interpreted programming language known for its
124
+ simplicity and readability. It was created by Guido van Rossum and first
125
+ released in 1991.
126
+
127
+ Key features:
128
+ • Easy to learn and use
129
+ • Extensive standard library
130
+ • Cross-platform compatibility
131
+ • Strong community support
132
+ ──────────────────────────────────────────────────
133
+ ¤ Can you give me an example?
134
+
135
+ Here's a simple Python example:
136
+
137
+ # Hello World in Python
138
+ print("Hello, World!")
139
+
140
+ # Working with variables
141
+ name = "Alice"
142
+ age = 25
143
+ print(f"My name is {name} and I am {age} years old.")
144
+
145
+ Python's syntax is clean and intuitive!
146
+ ──────────────────────────────────────────────────
147
+ ¤ @mention Save this conversation
148
+ ✅ Message posted successfully.
149
+ ──────────────────────────────────────────────────
150
+ ¤ ^C
151
+ 👋 Goodbye!
152
+ ```
153
+
154
+ **Visual Features:**
155
+ - **Colored messages**: User input appears in cyan, bot responses in green
156
+ - **Clean prompting**: Original `¤` prompt character maintained
157
+ - **Visual separators**: Clear lines between conversations
158
+ - **Rich formatting**: Markdown responses with syntax highlighting
159
+ - **Status indicators**: Animated thinking indicators and success messages
160
+ - **Emojis**: Friendly visual cues throughout the interface
161
+
162
+ ## Error Handling
163
+
164
+ The CLI provides helpful error messages for common issues:
165
+
166
+ - **Missing token**: Clear instructions on setting up `CODICENT_TOKEN`
167
+ - **Network errors**: Graceful handling of connection issues
168
+ - **API errors**: Detailed error messages from the Codicent API
169
+ - **Input validation**: Prevents empty or overly long inputs
170
+ - **Keyboard interrupts**: Clean exit handling
171
+
172
+ ## Development
173
+
174
+ ### Running Tests
175
+
176
+ ```bash
177
+ python -m pytest test_app.py -v
178
+ ```
179
+
180
+ ### Project Structure
181
+
182
+ - `app.py` - Main application logic (single-file architecture)
183
+ - `test_app.py` - Comprehensive test suite
184
+ - `setup.py` - Package configuration
185
+ - `requirements.txt` - Dependencies (now uses PyPI packages)
186
+
187
+ ### Dependencies
188
+
189
+ - **codicent-py**: Core API client for Codicent services (now available on PyPI)
190
+ - **rich**: Terminal formatting, markdown rendering, and animations
191
+
192
+ ## Troubleshooting
193
+
194
+ ### Common Issues
195
+
196
+ 1. **"CODICENT_TOKEN environment variable is not set"**
197
+ - Set the token: `export CODICENT_TOKEN="your_token"`
198
+ - Verify it's set: `echo $CODICENT_TOKEN`
199
+
200
+ 2. **"Network error: Unable to connect to Codicent API"**
201
+ - Check your internet connection
202
+ - Verify the Codicent API is accessible
203
+ - Try again with `--verbose` for more details
204
+
205
+ 3. **"Failed to initialize Codicent API client"**
206
+ - Verify your token is valid
207
+ - Check if the codicent-py package is properly installed
208
+
209
+ ### Getting Help
210
+
211
+ - Use `codicent --help` for usage information
212
+ - Use `codicent --verbose` for detailed logging
213
+ - Check the [Codicent documentation](https://github.com/izaxon/codicent-py) for API details
214
+
215
+ ## License
216
+
217
+ This project is licensed under the MIT License.