ploston-cli 1.0.0__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,99 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v4
18
+
19
+ - name: Set up Python
20
+ run: uv python install 3.12
21
+
22
+ - name: Install dependencies
23
+ run: uv sync --all-extras
24
+
25
+ - name: Run ruff check
26
+ run: uv run ruff check src/ tests/
27
+
28
+ - name: Run ruff format check
29
+ run: uv run ruff format --check src/ tests/
30
+
31
+ unit-tests:
32
+ name: Unit Tests (Python ${{ matrix.python-version }})
33
+ runs-on: ubuntu-latest
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ python-version: ["3.12", "3.13"]
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+
41
+ - name: Install uv
42
+ uses: astral-sh/setup-uv@v4
43
+
44
+ - name: Set up Python ${{ matrix.python-version }}
45
+ run: uv python install ${{ matrix.python-version }}
46
+
47
+ - name: Install dependencies
48
+ run: uv sync --all-extras
49
+
50
+ - name: Run unit tests
51
+ run: |
52
+ uv run pytest tests/unit/ -v \
53
+ --cov=ploston_cli \
54
+ --cov-report=xml \
55
+ --cov-report=html \
56
+ --junitxml=junit-unit-${{ matrix.python-version }}.xml
57
+
58
+ - name: Upload test results
59
+ uses: actions/upload-artifact@v4
60
+ if: always()
61
+ with:
62
+ name: test-results-${{ matrix.python-version }}
63
+ path: junit-unit-${{ matrix.python-version }}.xml
64
+
65
+ - name: Upload coverage report
66
+ uses: actions/upload-artifact@v4
67
+ if: matrix.python-version == '3.12'
68
+ with:
69
+ name: coverage-report
70
+ path: htmlcov/
71
+
72
+ build:
73
+ name: Build
74
+ runs-on: ubuntu-latest
75
+ needs: [lint, unit-tests]
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+
79
+ - name: Install uv
80
+ uses: astral-sh/setup-uv@v4
81
+
82
+ - name: Set up Python
83
+ run: uv python install 3.12
84
+
85
+ - name: Build package
86
+ run: uv build
87
+
88
+ - name: Check package installable
89
+ run: |
90
+ uv venv .test-venv
91
+ uv pip install --python .test-venv dist/*.whl
92
+ uv run --python .test-venv python -c "import ploston_cli; print(ploston_cli.__name__)"
93
+
94
+ - name: Upload build artifacts
95
+ uses: actions/upload-artifact@v4
96
+ with:
97
+ name: dist
98
+ path: dist/
99
+
@@ -0,0 +1,79 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ test_pypi:
9
+ description: 'Publish to Test PyPI instead of PyPI'
10
+ required: false
11
+ default: 'false'
12
+ type: boolean
13
+
14
+ jobs:
15
+ build:
16
+ name: Build distribution
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v4
23
+
24
+ - name: Set up Python
25
+ run: uv python install 3.12
26
+
27
+ - name: Build package
28
+ run: uv build
29
+
30
+ - name: Store distribution packages
31
+ uses: actions/upload-artifact@v4
32
+ with:
33
+ name: python-package-distributions
34
+ path: dist/
35
+
36
+ publish-to-pypi:
37
+ name: Publish to PyPI
38
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi == 'false')
39
+ needs: [build]
40
+ runs-on: ubuntu-latest
41
+ environment:
42
+ name: pypi
43
+ url: https://pypi.org/p/ploston-cli
44
+ permissions:
45
+ id-token: write # OIDC publishing
46
+
47
+ steps:
48
+ - name: Download distribution packages
49
+ uses: actions/download-artifact@v4
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+
54
+ - name: Publish to PyPI
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+
57
+ publish-to-test-pypi:
58
+ name: Publish to Test PyPI
59
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi == 'true'
60
+ needs: [build]
61
+ runs-on: ubuntu-latest
62
+ environment:
63
+ name: test-pypi
64
+ url: https://test.pypi.org/p/ploston-cli
65
+ permissions:
66
+ id-token: write # OIDC publishing
67
+
68
+ steps:
69
+ - name: Download distribution packages
70
+ uses: actions/download-artifact@v4
71
+ with:
72
+ name: python-package-distributions
73
+ path: dist/
74
+
75
+ - name: Publish to Test PyPI
76
+ uses: pypa/gh-action-pypi-publish@release/v1
77
+ with:
78
+ repository-url: https://test.pypi.org/legacy/
79
+
@@ -0,0 +1,16 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .venv/
11
+
12
+ # Coverage
13
+ .coverage
14
+ coverage.xml
15
+ htmlcov/
16
+
@@ -0,0 +1,128 @@
1
+ # Ploston CLI
2
+ # ===========
3
+ # Development commands for local testing and PyPI publishing
4
+ #
5
+ # Quick start:
6
+ # make install # Install dependencies
7
+ # make test # Run tests
8
+ # make build # Build package
9
+
10
+ # Configuration
11
+ PYTHON = uv run python
12
+ PYTEST = uv run pytest
13
+ PACKAGE_NAME = ploston-cli
14
+
15
+ # Colors
16
+ CYAN := \033[36m
17
+ GREEN := \033[32m
18
+ YELLOW := \033[33m
19
+ RED := \033[31m
20
+ RESET := \033[0m
21
+
22
+ .PHONY: help install test lint format build publish-test publish clean
23
+
24
+ # =============================================================================
25
+ # HELP
26
+ # =============================================================================
27
+
28
+ help:
29
+ @echo ""
30
+ @echo "$(CYAN)Ploston CLI$(RESET)"
31
+ @echo "==========="
32
+ @echo ""
33
+ @echo "$(GREEN)Development:$(RESET)"
34
+ @echo " make install Install dependencies with uv"
35
+ @echo " make test Run all tests"
36
+ @echo " make test-unit Run unit tests only"
37
+ @echo " make lint Run ruff linter"
38
+ @echo " make format Format code with ruff"
39
+ @echo " make check Run lint + format check + tests"
40
+ @echo ""
41
+ @echo "$(GREEN)Build & Publish:$(RESET)"
42
+ @echo " make build Build package (sdist + wheel)"
43
+ @echo " make publish-test Publish to TestPyPI"
44
+ @echo " make publish Publish to PyPI"
45
+ @echo ""
46
+ @echo "$(GREEN)Maintenance:$(RESET)"
47
+ @echo " make clean Remove build artifacts"
48
+ @echo ""
49
+
50
+ # =============================================================================
51
+ # DEVELOPMENT
52
+ # =============================================================================
53
+
54
+ ## Install dependencies
55
+ install:
56
+ @echo "$(CYAN)Installing dependencies...$(RESET)"
57
+ uv sync --all-extras
58
+ @echo "$(GREEN)Done!$(RESET)"
59
+
60
+ ## Run all tests
61
+ test:
62
+ @echo "$(CYAN)Running all tests...$(RESET)"
63
+ $(PYTEST) tests/ -v
64
+
65
+ ## Run unit tests only
66
+ test-unit:
67
+ @echo "$(CYAN)Running unit tests...$(RESET)"
68
+ $(PYTEST) tests/unit/ -v
69
+
70
+ ## Run tests with coverage
71
+ test-cov:
72
+ @echo "$(CYAN)Running tests with coverage...$(RESET)"
73
+ $(PYTEST) tests/ -v --cov=ploston_cli --cov-report=html --cov-report=term
74
+
75
+ ## Run linter
76
+ lint:
77
+ @echo "$(CYAN)Running linter...$(RESET)"
78
+ uv run ruff check src/ tests/
79
+ uv run ruff format --check src/ tests/
80
+
81
+ ## Format code
82
+ format:
83
+ @echo "$(CYAN)Formatting code...$(RESET)"
84
+ uv run ruff format src/ tests/
85
+ uv run ruff check --fix src/ tests/
86
+
87
+ ## Run all checks
88
+ check: lint test
89
+ @echo "$(GREEN)All checks passed!$(RESET)"
90
+
91
+ # =============================================================================
92
+ # BUILD & PUBLISH
93
+ # =============================================================================
94
+
95
+ ## Build package
96
+ build: clean
97
+ @echo "$(CYAN)Building package...$(RESET)"
98
+ uv build
99
+ @echo "$(GREEN)Build complete!$(RESET)"
100
+ @ls -la dist/
101
+
102
+ ## Publish to TestPyPI
103
+ publish-test: build
104
+ @echo "$(CYAN)Publishing to TestPyPI...$(RESET)"
105
+ uv publish --publish-url https://test.pypi.org/legacy/
106
+ @echo "$(GREEN)Published to TestPyPI!$(RESET)"
107
+ @echo "Install with: pip install -i https://test.pypi.org/simple/ $(PACKAGE_NAME)"
108
+
109
+ ## Publish to PyPI
110
+ publish: build
111
+ @echo "$(CYAN)Publishing to PyPI...$(RESET)"
112
+ uv publish
113
+ @echo "$(GREEN)Published to PyPI!$(RESET)"
114
+ @echo "Install with: pip install $(PACKAGE_NAME)"
115
+
116
+ # =============================================================================
117
+ # MAINTENANCE
118
+ # =============================================================================
119
+
120
+ ## Remove build artifacts
121
+ clean:
122
+ @echo "$(CYAN)Cleaning build artifacts...$(RESET)"
123
+ rm -rf build/ dist/ *.egg-info/
124
+ rm -rf .pytest_cache/ .mypy_cache/ .ruff_cache/
125
+ rm -rf htmlcov/ .coverage
126
+ find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
127
+ @echo "$(GREEN)Clean!$(RESET)"
128
+
@@ -0,0 +1,339 @@
1
+ Metadata-Version: 2.4
2
+ Name: ploston-cli
3
+ Version: 1.0.0
4
+ Summary: CLI for Ploston - Deterministic Agent Execution Layer
5
+ Project-URL: Homepage, https://github.com/ostanlabs/ploston-cli
6
+ Project-URL: Documentation, https://ostanlabs.netlify.app
7
+ Project-URL: Repository, https://github.com/ostanlabs/ploston-cli
8
+ Author-email: Ostan Labs <hello@ostanlabs.com>
9
+ License-Expression: Apache-2.0
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Python: >=3.12
16
+ Requires-Dist: click>=8.1.0
17
+ Requires-Dist: httpx>=0.26.0
18
+ Requires-Dist: ploston-core<2.0.0,>=1.0.0
19
+ Requires-Dist: pyyaml>=6.0
20
+ Requires-Dist: rich>=13.7.0
21
+ Provides-Extra: dev
22
+ Requires-Dist: mypy>=1.8.0; extra == 'dev'
23
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
24
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
25
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
26
+ Requires-Dist: ruff>=0.2.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Ploston CLI
30
+
31
+ Command-line interface for Ploston - Deterministic Agent Execution Layer
32
+
33
+ ## Overview
34
+
35
+ The Ploston CLI provides a powerful command-line interface for interacting with Ploston servers.
36
+ It works with both the open-source community tier and enterprise tier.
37
+
38
+ ## Installation
39
+
40
+ ### From PyPI
41
+
42
+ ```bash
43
+ pip install ploston-cli
44
+ ```
45
+
46
+ ### From Source
47
+
48
+ ```bash
49
+ git clone https://github.com/ostanlabs/ploston-cli.git
50
+ cd ploston-cli
51
+ make install
52
+ ```
53
+
54
+ ### Verify Installation
55
+
56
+ ```bash
57
+ ploston version
58
+ ```
59
+
60
+ ## Quick Start
61
+
62
+ ```bash
63
+ # Start the MCP server
64
+ ploston serve
65
+
66
+ # List available workflows
67
+ ploston workflows list
68
+
69
+ # Run a workflow
70
+ ploston run my-workflow -i key=value
71
+
72
+ # Validate a workflow file
73
+ ploston validate workflow.yaml
74
+ ```
75
+
76
+ ## Commands
77
+
78
+ ### Global Options
79
+
80
+ | Option | Description |
81
+ |--------|-------------|
82
+ | `-c, --config PATH` | Config file path |
83
+ | `-v, --verbose` | Increase verbosity (can be repeated) |
84
+ | `-q, --quiet` | Suppress output |
85
+ | `--json` | Output as JSON |
86
+
87
+ ### `ploston serve`
88
+
89
+ Start the MCP server.
90
+
91
+ ```bash
92
+ # Start with default settings (stdio transport)
93
+ ploston serve
94
+
95
+ # Start with HTTP transport
96
+ ploston serve --transport http --port 8080
97
+
98
+ # Start with REST API enabled
99
+ ploston serve --transport http --with-api --api-docs
100
+
101
+ # Force configuration mode
102
+ ploston serve --mode configuration
103
+ ```
104
+
105
+ | Option | Default | Description |
106
+ |--------|---------|-------------|
107
+ | `--transport` | `stdio` | Transport type (`stdio` or `http`) |
108
+ | `--host` | `0.0.0.0` | HTTP host |
109
+ | `--port` | `8080` | HTTP port |
110
+ | `--no-watch` | `false` | Disable config hot-reload |
111
+ | `--mode` | auto | Force mode (`configuration` or `running`) |
112
+ | `--with-api` | `false` | Enable REST API (HTTP only) |
113
+ | `--api-prefix` | `/api/v1` | REST API URL prefix |
114
+ | `--api-docs` | `false` | Enable OpenAPI docs at /docs |
115
+
116
+ ### `ploston run`
117
+
118
+ Execute a workflow.
119
+
120
+ ```bash
121
+ # Run with inline inputs
122
+ ploston run my-workflow -i name=John -i age=30
123
+
124
+ # Run with input file
125
+ ploston run my-workflow --input-file inputs.yaml
126
+
127
+ # Run with timeout
128
+ ploston run my-workflow -t 60
129
+
130
+ # Get JSON output
131
+ ploston --json run my-workflow
132
+ ```
133
+
134
+ | Option | Description |
135
+ |--------|-------------|
136
+ | `-i, --input KEY=VALUE` | Input parameter (can be repeated) |
137
+ | `--input-file PATH` | YAML/JSON file with inputs |
138
+ | `-t, --timeout SECONDS` | Execution timeout |
139
+
140
+ ### `ploston validate`
141
+
142
+ Validate a workflow YAML file.
143
+
144
+ ```bash
145
+ # Basic validation
146
+ ploston validate workflow.yaml
147
+
148
+ # Strict mode (warnings as errors)
149
+ ploston validate --strict workflow.yaml
150
+
151
+ # Check that tools exist (requires MCP connection)
152
+ ploston validate --check-tools workflow.yaml
153
+ ```
154
+
155
+ | Option | Description |
156
+ |--------|-------------|
157
+ | `--strict` | Treat warnings as errors |
158
+ | `--check-tools` | Verify tools exist |
159
+
160
+ ### `ploston workflows`
161
+
162
+ Manage workflows.
163
+
164
+ ```bash
165
+ # List all workflows
166
+ ploston workflows list
167
+
168
+ # Show workflow details
169
+ ploston workflows show my-workflow
170
+
171
+ # JSON output
172
+ ploston --json workflows list
173
+ ```
174
+
175
+ ### `ploston tools`
176
+
177
+ Manage tools.
178
+
179
+ ```bash
180
+ # List all tools
181
+ ploston tools list
182
+
183
+ # Filter by source
184
+ ploston tools list --source mcp
185
+
186
+ # Filter by server
187
+ ploston tools list --server native-tools
188
+
189
+ # Show tool details
190
+ ploston tools show read_file
191
+
192
+ # Refresh tool schemas
193
+ ploston tools refresh
194
+ ploston tools refresh --server native-tools
195
+ ```
196
+
197
+ | Option | Description |
198
+ |--------|-------------|
199
+ | `--source` | Filter by source (`mcp` or `system`) |
200
+ | `--server` | Filter by MCP server name |
201
+ | `--status` | Filter by status (`available` or `unavailable`) |
202
+
203
+ ### `ploston config`
204
+
205
+ Manage configuration.
206
+
207
+ ```bash
208
+ # Show full config
209
+ ploston config show
210
+
211
+ # Show specific section
212
+ ploston config show --section mcp
213
+
214
+ # JSON output
215
+ ploston --json config show
216
+ ```
217
+
218
+ Valid sections: `server`, `mcp`, `tools`, `workflows`, `execution`, `python_exec`, `logging`, `plugins`, `security`, `telemetry`
219
+
220
+ ### `ploston api`
221
+
222
+ Start standalone REST API server.
223
+
224
+ ```bash
225
+ # Start API server
226
+ ploston api --port 8080
227
+
228
+ # With authentication required
229
+ ploston api --require-auth
230
+
231
+ # With rate limiting
232
+ ploston api --rate-limit 100
233
+
234
+ # With SQLite execution store
235
+ ploston api --db ./executions.db
236
+ ```
237
+
238
+ | Option | Default | Description |
239
+ |--------|---------|-------------|
240
+ | `--host` | `0.0.0.0` | Host to bind to |
241
+ | `--port` | `8080` | Port to bind to |
242
+ | `--prefix` | `/api/v1` | API prefix |
243
+ | `--no-docs` | `false` | Disable OpenAPI docs |
244
+ | `--require-auth` | `false` | Require API key |
245
+ | `--rate-limit` | `0` | Requests per minute (0=disabled) |
246
+ | `--db` | - | SQLite database path |
247
+
248
+ ### `ploston version`
249
+
250
+ Show version information.
251
+
252
+ ```bash
253
+ ploston version
254
+ ```
255
+
256
+ ## Configuration
257
+
258
+ The CLI looks for configuration in the following order:
259
+
260
+ 1. Path specified with `-c/--config`
261
+ 2. `./ael-config.yaml` (current directory)
262
+ 3. `~/.ael/config.yaml` (home directory)
263
+
264
+ If no config is found, the server starts in **configuration mode** where you can use MCP tools to set up the configuration.
265
+
266
+ ### Example Config
267
+
268
+ ```yaml
269
+ # ael-config.yaml
270
+ server:
271
+ host: 0.0.0.0
272
+ port: 8080
273
+
274
+ mcp:
275
+ servers:
276
+ native-tools:
277
+ command: python
278
+ args: ["-m", "native_tools"]
279
+
280
+ workflows:
281
+ paths:
282
+ - ./workflows/
283
+
284
+ logging:
285
+ level: INFO
286
+ ```
287
+
288
+ ## JSON Output
289
+
290
+ All commands support `--json` for machine-readable output:
291
+
292
+ ```bash
293
+ # List workflows as JSON
294
+ ploston --json workflows list
295
+
296
+ # Run workflow with JSON output
297
+ ploston --json run my-workflow -i key=value
298
+
299
+ # Validate with JSON output
300
+ ploston --json validate workflow.yaml
301
+ ```
302
+
303
+ ## Development
304
+
305
+ ### Prerequisites
306
+
307
+ - Python 3.12+
308
+ - [uv](https://github.com/astral-sh/uv) package manager
309
+
310
+ ### Setup
311
+
312
+ ```bash
313
+ make install
314
+ ```
315
+
316
+ ### Commands
317
+
318
+ ```bash
319
+ make help # Show all commands
320
+ make test # Run all tests
321
+ make test-unit # Run unit tests only
322
+ make lint # Run linter
323
+ make format # Format code
324
+ make check # Run lint + tests
325
+ make build # Build package
326
+ ```
327
+
328
+ ## Features
329
+
330
+ - **HTTP-only client**: No server dependencies, works with any Ploston server
331
+ - **Tier detection**: Automatically detects community vs enterprise features
332
+ - **Rich output**: Beautiful terminal output with colors and formatting
333
+ - **JSON mode**: Machine-readable output for scripting
334
+ - **Config hot-reload**: Automatically reloads config changes
335
+ - **Dual-mode server**: Run MCP and REST API simultaneously
336
+
337
+ ## License
338
+
339
+ Apache-2.0