please-cli 0.1.0
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/LICENSE.md +21 -0
- package/README.md +125 -0
- package/dist/cli.js +23471 -0
- package/package.json +60 -0
- package/scripts/ask.ps1 +35 -0
- package/scripts/ask.sh +37 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2026] [Umut Şen]
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# please-cli
|
|
2
|
+
|
|
3
|
+
AI-powered shell command assistant. Ask in natural language, get executable shell commands.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Natural language to shell commands** - Describe what you want, get the exact command
|
|
8
|
+
- **Interactive refinement** - Iterate on commands in a chat loop
|
|
9
|
+
- **Multiple AI providers** - Google Gemini, OpenAI, Ollama, or LM Studio
|
|
10
|
+
- **Dynamic model selection** - Fetch and choose from available models
|
|
11
|
+
- **Clarification questions** - AI asks follow-ups when context is needed
|
|
12
|
+
- **Beautiful TUI** - Built with @clack/prompts and marked-terminal
|
|
13
|
+
- **Shell integration** - Commands added to your shell history and executed
|
|
14
|
+
- **Cross-platform** - Bash, Zsh, and PowerShell support
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### 1. Install dependencies
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cd please-cli
|
|
22
|
+
bun install
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. First-time setup
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
bun run src/index.ts --setup
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This will prompt you to:
|
|
32
|
+
- Choose an AI provider (Google Gemini, OpenAI, Ollama, or LM Studio)
|
|
33
|
+
- Enter your API key
|
|
34
|
+
- Select a model (fetched dynamically from the provider)
|
|
35
|
+
|
|
36
|
+
### 3. Install shell wrapper
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Build install
|
|
40
|
+
# Points to the built CLI
|
|
41
|
+
bun run src/cli.ts --install
|
|
42
|
+
|
|
43
|
+
# Dev mode install
|
|
44
|
+
# Points to the dev CLI
|
|
45
|
+
bun run src/cli.ts --install --dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
After installing, reload your shell to activate the wrapper:
|
|
49
|
+
```bash
|
|
50
|
+
source ~/.bashrc # or ~/.zshrc
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4. Start asking
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Interactive mode
|
|
57
|
+
pls
|
|
58
|
+
|
|
59
|
+
# With a query
|
|
60
|
+
pls "list all docker containers"
|
|
61
|
+
pls "find files modified in the last 24 hours"
|
|
62
|
+
pls "compress all images in this directory"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
pls [options] [query]
|
|
69
|
+
|
|
70
|
+
Usage:
|
|
71
|
+
pls Start interactive mode
|
|
72
|
+
pls <query> Ask a natural language query
|
|
73
|
+
|
|
74
|
+
Options:
|
|
75
|
+
-h, --help Show help
|
|
76
|
+
--setup Run configuration setup
|
|
77
|
+
--install Install shell wrapper
|
|
78
|
+
--install --dev Install wrapper in dev mode
|
|
79
|
+
--model [name] Change the model (prompts if no name given)
|
|
80
|
+
|
|
81
|
+
Examples:
|
|
82
|
+
pls "show git log with graph"
|
|
83
|
+
pls "create a tar.gz of the src folder"
|
|
84
|
+
pls --model gemini-2.5-pro
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
Config is stored at `~/.config/please-cli/config.json`:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"provider": "google",
|
|
94
|
+
"apiKey": "your-api-key",
|
|
95
|
+
"model": "gemini-2.5-flash"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Supported Providers
|
|
100
|
+
|
|
101
|
+
| Provider | Default Model | Notes |
|
|
102
|
+
|----------|---------------|-------|
|
|
103
|
+
| Google | `gemini-2.5-flash` | Recommended |
|
|
104
|
+
| OpenAI | `gpt-4o-mini` | Requires API key |
|
|
105
|
+
| Ollama | `llama3.2` | Local, endpoint: `http://localhost:11434` |
|
|
106
|
+
| LM Studio | `local-model` | Local, endpoint: `http://localhost:1234` |
|
|
107
|
+
|
|
108
|
+
## Shell Wrapper
|
|
109
|
+
|
|
110
|
+
The shell wrapper is required for commands to execute in your current shell. It:
|
|
111
|
+
1. Calls the CLI with your query
|
|
112
|
+
2. Checks for an approved command in `~/.ai_cmd_temp`
|
|
113
|
+
3. Adds the command to shell history
|
|
114
|
+
4. Executes it with `eval`
|
|
115
|
+
|
|
116
|
+
See `scripts/ask.sh` (Bash/Zsh) and `scripts/ask.ps1` (PowerShell) for reference implementations.
|
|
117
|
+
|
|
118
|
+
## Tech Stack
|
|
119
|
+
|
|
120
|
+
- **Runtime**: Bun
|
|
121
|
+
- **Language**: TypeScript
|
|
122
|
+
- **Validation**: Zod
|
|
123
|
+
- **TUI**: @clack/prompts, picocolors
|
|
124
|
+
- **Markdown**: marked, marked-terminal
|
|
125
|
+
- **AI**: Vercel AI SDK
|