prompt-language-shell 0.5.0 → 0.5.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.
- package/README.md +114 -10
- package/dist/config/INTROSPECT.md +4 -3
- package/dist/ui/Introspect.js +1 -0
- package/dist/ui/Welcome.js +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Your personal command-line concierge. Ask politely, and it gets things done.
|
|
4
4
|
|
|
5
|
+
> **Note:** This project is in early preview. Features and APIs may change as
|
|
6
|
+
> development continues.
|
|
7
|
+
|
|
5
8
|
## Installation
|
|
6
9
|
|
|
7
10
|
```bash
|
|
@@ -14,30 +17,74 @@ On first run, `pls` walks you through a quick setup. Your settings will be saved
|
|
|
14
17
|
|
|
15
18
|
## Usage
|
|
16
19
|
|
|
17
|
-
Type `pls` followed by your request in natural language
|
|
20
|
+
Type `pls` followed by your request in natural language.
|
|
21
|
+
|
|
22
|
+
To see what `pls` can
|
|
23
|
+
do, start by listing available capabilities:
|
|
18
24
|
|
|
19
|
-
```bash
|
|
20
|
-
pls change dir to ~
|
|
21
25
|
```
|
|
26
|
+
$ pls list skills
|
|
27
|
+
|
|
28
|
+
Here's what I can help with:
|
|
29
|
+
|
|
30
|
+
- Introspect - list available capabilities and skills
|
|
31
|
+
- Config - manage and configure system settings
|
|
32
|
+
- Answer - respond to questions and provide information
|
|
33
|
+
- Execute - run shell commands and process operations
|
|
34
|
+
```
|
|
22
35
|
|
|
23
|
-
|
|
36
|
+
Skills are custom workflows you can define to teach `pls` about your specific
|
|
37
|
+
projects and commands. Once defined, you can use them naturally:
|
|
24
38
|
|
|
25
39
|
```
|
|
26
|
-
|
|
27
|
-
|
|
40
|
+
$ pls build project
|
|
41
|
+
|
|
42
|
+
Here's my plan.
|
|
43
|
+
|
|
44
|
+
- Navigate to project directory
|
|
45
|
+
- Compile source code
|
|
28
46
|
```
|
|
29
47
|
|
|
30
48
|
You can provide multiple requests at once:
|
|
31
49
|
|
|
32
50
|
```
|
|
33
|
-
|
|
51
|
+
$ pls install deps, run tests and build
|
|
52
|
+
|
|
53
|
+
Here's what I'll do.
|
|
54
|
+
|
|
34
55
|
- Install dependencies
|
|
35
56
|
- Run tests
|
|
36
|
-
-
|
|
57
|
+
- Build the project
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
When `pls` needs clarification, it will present options to choose from:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
$ pls deploy
|
|
64
|
+
|
|
65
|
+
Let me clarify.
|
|
66
|
+
|
|
67
|
+
→ Choose which environment to deploy to:
|
|
68
|
+
- Deploy to staging
|
|
69
|
+
- Deploy to production
|
|
37
70
|
```
|
|
38
71
|
|
|
39
72
|
Run `pls` without arguments to see the welcome screen.
|
|
40
73
|
|
|
74
|
+
## How It Works
|
|
75
|
+
|
|
76
|
+
When you make a request, `pls` interprets your intent and creates a structured
|
|
77
|
+
plan breaking down the work into individual tasks. You'll see this plan
|
|
78
|
+
displayed in your terminal before anything executes.
|
|
79
|
+
|
|
80
|
+
After reviewing the plan, you can confirm to proceed or cancel if something
|
|
81
|
+
doesn't look right. Once confirmed, `pls` executes each task sequentially and
|
|
82
|
+
shows real-time progress and results.
|
|
83
|
+
|
|
84
|
+
If you've defined custom skills, `pls` uses them to understand your
|
|
85
|
+
project-specific workflows and translate high-level requests into the exact
|
|
86
|
+
commands your environment requires.
|
|
87
|
+
|
|
41
88
|
## Configuration
|
|
42
89
|
|
|
43
90
|
Your configuration is stored in `~/.plsrc` as a YAML file. Supported settings:
|
|
@@ -47,9 +94,66 @@ Your configuration is stored in `~/.plsrc` as a YAML file. Supported settings:
|
|
|
47
94
|
|
|
48
95
|
## Skills
|
|
49
96
|
|
|
50
|
-
|
|
97
|
+
Skills let you teach `pls` about your project-specific workflows. Create
|
|
98
|
+
markdown files in `~/.pls/skills/` to define custom operations that `pls` can
|
|
99
|
+
understand and execute.
|
|
100
|
+
|
|
101
|
+
### Structure
|
|
102
|
+
|
|
103
|
+
Each skill file uses a simple markdown format:
|
|
104
|
+
|
|
105
|
+
- **Name**: What you call this workflow (e.g., "Build Project")
|
|
106
|
+
- **Description**: What it does and any variants or options
|
|
107
|
+
- **Steps**: What needs to happen, in order
|
|
108
|
+
- **Execution** (optional): The actual shell commands to run
|
|
109
|
+
|
|
110
|
+
### Example
|
|
111
|
+
|
|
112
|
+
Here's a skill that builds different project variants:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
### Name
|
|
116
|
+
Build Project
|
|
117
|
+
|
|
118
|
+
### Description
|
|
119
|
+
Build a project in different configurations:
|
|
120
|
+
- dev (debug build with source maps)
|
|
121
|
+
- prod (optimized build)
|
|
122
|
+
- test (with test coverage)
|
|
123
|
+
|
|
124
|
+
### Steps
|
|
125
|
+
- Navigate to the project directory
|
|
126
|
+
- Install dependencies if needed
|
|
127
|
+
- Run the {ENV} build script
|
|
128
|
+
- Generate build artifacts
|
|
51
129
|
|
|
52
|
-
|
|
130
|
+
### Execution
|
|
131
|
+
- cd ~/projects/next
|
|
132
|
+
- npm install
|
|
133
|
+
- npm run build:{ENV}
|
|
134
|
+
- cp -r dist/ builds/{ENV}/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
With this skill defined, you can use natural language like:
|
|
138
|
+
```
|
|
139
|
+
$ pls build project for production
|
|
140
|
+
$ pls build dev environment
|
|
141
|
+
$ pls build with testing enabled
|
|
142
|
+
```
|
|
143
|
+
The `{ENV}` placeholder gets replaced with the variant you specify.
|
|
144
|
+
Instead of remembering the exact commands and paths for each environment, just
|
|
145
|
+
tell `pls` what you want in plain English. The Execution section ensures the right commands run every time.
|
|
146
|
+
|
|
147
|
+
### Keep It Short
|
|
148
|
+
|
|
149
|
+
Skills also work with concise commands. Once you've taught `pls` about your
|
|
150
|
+
workflow, you can use minimal phrasing:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
$ pls build prod
|
|
154
|
+
$ pls build dev
|
|
155
|
+
$ pls build test
|
|
156
|
+
```
|
|
53
157
|
|
|
54
158
|
## Development
|
|
55
159
|
|
|
@@ -133,9 +133,10 @@ Examples:
|
|
|
133
133
|
|
|
134
134
|
When user asks "list your skills", create an introductory message like "here
|
|
135
135
|
are my capabilities:" followed by tasks for built-in capabilities (Introspect,
|
|
136
|
-
Config, Answer, Execute), then indirect workflow capabilities (
|
|
137
|
-
Report).
|
|
138
|
-
|
|
136
|
+
Config, Answer, Execute), then indirect workflow capabilities (Plan, Validate,
|
|
137
|
+
Report).
|
|
138
|
+
|
|
139
|
+
Each task uses type "introspect" with an action describing the capability.
|
|
139
140
|
|
|
140
141
|
### Example 2: Filtered Skills
|
|
141
142
|
|
package/dist/ui/Introspect.js
CHANGED
|
@@ -78,6 +78,7 @@ export function Introspect({ tasks, state, service, children, debug = false, onE
|
|
|
78
78
|
// Filter out internal capabilities when not in debug mode
|
|
79
79
|
if (!debug) {
|
|
80
80
|
capabilities = capabilities.filter((cap) => cap.name.toUpperCase() !== 'PLAN' &&
|
|
81
|
+
cap.name.toUpperCase() !== 'VALIDATE' &&
|
|
81
82
|
cap.name.toUpperCase() !== 'REPORT');
|
|
82
83
|
}
|
|
83
84
|
setIsLoading(false);
|
package/dist/ui/Welcome.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
+
import { Palette } from '../services/colors.js';
|
|
3
4
|
import { Panel } from './Panel.js';
|
|
5
|
+
export function Welcome({ app }) {
|
|
6
|
+
return (_jsx(Box, { alignSelf: "flex-start", children: _jsxs(Panel, { children: [_jsx(Header, { app: app }), _jsx(Description, { description: app.description }), _jsx(Usage, {})] }) }));
|
|
7
|
+
}
|
|
4
8
|
function Header({ app }) {
|
|
5
9
|
const words = app.name
|
|
6
10
|
.split('-')
|
|
7
11
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1));
|
|
8
|
-
return (_jsxs(Box, { marginBottom: 1, gap: 1, children: [words.map((word, index) => (_jsx(Text, { color:
|
|
12
|
+
return (_jsxs(Box, { marginBottom: 1, gap: 1, children: [words.map((word, index) => (_jsx(Text, { color: Palette.BrightGreen, bold: true, children: word }, index))), _jsxs(Text, { color: Palette.AshGray, children: ["v", app.version] }), app.isDev && _jsx(Text, { color: Palette.Yellow, children: "dev" })] }));
|
|
9
13
|
}
|
|
10
14
|
function Description({ description }) {
|
|
11
15
|
const lines = description
|
|
12
16
|
.split('. ')
|
|
13
17
|
.map((line) => line.replace(/\.$/, ''))
|
|
14
18
|
.filter(Boolean);
|
|
15
|
-
return (_jsx(_Fragment, { children: lines.map((line, index) => (_jsx(Box, { children: _jsxs(Text, { color:
|
|
19
|
+
return (_jsx(_Fragment, { children: lines.map((line, index) => (_jsx(Box, { children: _jsxs(Text, { color: Palette.White, children: [line, "."] }) }, index))) }));
|
|
16
20
|
}
|
|
17
21
|
function Usage() {
|
|
18
|
-
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(
|
|
22
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, gap: 1, children: [_jsx(Section, { title: "Get started:", children: _jsx(Example, { children: "list skills" }) }), _jsx(Section, { title: "Usage:", children: _jsx(Example, { children: "[describe your request]" }) })] }));
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
24
|
+
function Section({ title, children, }) {
|
|
25
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: Palette.White, children: title }), children] }));
|
|
26
|
+
}
|
|
27
|
+
function Example({ children }) {
|
|
28
|
+
return (_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: Palette.Gray, children: ">" }), _jsx(Text, { color: Palette.BrightGreen, bold: true, children: "pls" }), _jsx(Text, { color: Palette.Yellow, children: children })] }));
|
|
22
29
|
}
|