spaceshift
An interactive CLI prompt exploration toolkit powered by LLMs. Manipulate prompts through transforms, navigate the full space of perspectives, and evaluate across prompts and models to find what works best.
Full documentation at spcshft.com
pip install spaceshift
spaceshift
Pick a mode, pick a model from categorized rankings, enter your prompt. Results save as structured markdown with YAML frontmatter, and the built-in viewer opens automatically.
AutoPrompt — autonomous prompt optimization
AutoPrompt uses three LLMs to iteratively improve your prompt without you touching it. A prompting model proposes edits via tools, an output model runs each candidate, and a judge model runs pairwise evaluation to pick the winner. The prompter doesn't just rewrite your question — it can edit the upstream system prompt and add/remove/replace preset followups, exploring the full multi-turn scaffold.
Each turn the prompter chooses one of five tools (edit_user_prompt, edit_system_prompt, add_followup, edit_followup, remove_followup), gives a short rationale, and gets terse win/loss feedback from a swap-averaged pairwise eval against the current baseline. Metrics are resolved once upfront (not re-rolled every turn) so the prompter is scored on a stable yardstick, and you can optionally expose those metrics to the prompter so it can target them directly.
The final candidate (system + user + followups) prints to the terminal alongside the original baseline, and every turn plus a run summary are saved as markdown with YAML frontmatter for replay in the viewer.
Install
pip install spaceshift
On first run, spaceshift guides you through setting up API keys:
$ spaceshift
No API keys found. Let's set up your providers.
OpenAI (press Enter to skip): sk-proj-...
✓ OpenAI key saved
Anthropic (press Enter to skip): sk-ant-...
✓ Anthropic key saved
Google Gemini (press Enter to skip): [Enter]
Together.AI (press Enter to skip): [Enter]
xAI (press Enter to skip): [Enter]
✓ Configuration saved to ~/.spaceshift/config.json
Keys are stored in ~/.spaceshift/config.json and available globally. Update them anytime via the Manage API Keys option in the main menu.
Modes
Prompt Manipulate
Transform a prompt through 22 built-in operations — abstraction up/down, inversion, reflection, rotation, dimension shifts, translations, and more — then optionally generate responses for each variant.
Prompt Tree
Explore a prompt in three directions simultaneously: sub (decomposition into specifics), super (abstraction upward), and side (lateral alternatives). Configure depth per direction through a guided wizard.
Prompt Chain
Build a multi-turn conversation by adding followups one at a time. Each turn runs with full prior context and saves alongside the chain history.
Compare Models
Run the same prompt across multiple models and rank the responses. Optionally add pairwise evaluation with a judge model and auto-generated or custom metrics.
Grid Search and Evaluation
Sweep across models × transforms simultaneously and rank every combination to find what works best.
AutoPrompt
Let a prompting model autonomously improve your prompt via tool-driven edits (user prompt, system prompt, followups) with pairwise eval deciding each round. See the top of this README for a walkthrough.
Viewing Results
Browse any output directory in the browser with the built-in viewer:
spaceshift view output_directory
Two-panel layout: sidebar with smart-sorted file list, content area with rendered markdown and frontmatter metadata cards. No dependencies — runs on Python's stdlib server with client-side markdown rendering.
Advanced Usage
While spaceshift is designed as a CLI tool, advanced users can import and use the underlying modules programmatically. This is unsupported — the CLI is the primary interface, and internal APIs may change without notice.
For those who want to explore anyway, the main modules are in spaceshift/ including LLM, prompt_tree, compare_models, grid_search, etc. See the source code for details.
Metadata
Release files for spaceshift 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spaceshift-2.1.0.tar.gz | 94.4 kB | Without provenance | Details for spaceshift-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spaceshift-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for spaceshift-2.1.0-py3-none-any.whl |
Total release size: 210.0 kB
Release files / spaceshift-2.1.0.tar.gz
| Download URL | spaceshift-2.1.0.tar.gz |
|---|---|
| Size | 94.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
994ecd04c269f259aa6f9fc60d0bce560287efd6bf9b37f51c7040f540c759da
|
|
BLAKE2b-256 checksum How to use checksums |
04e9968cb46f662ac7c5da5432a5dc8472eb87e492f16b2260914027d0fa9de2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / spaceshift-2.1.0-py3-none-any.whl
| Download URL | spaceshift-2.1.0-py3-none-any.whl |
|---|---|
| Size | 115.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fee884be3cb43b0d9f950e25d897dc2c7a35092bb58754f8b6da3ef812de0b1b
|
|
BLAKE2b-256 checksum How to use checksums |
5eb06d8e0ac0ac5fa1cfa931fb096b17759d66a87c403ed3b639bc6435d3c9fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for spaceshift 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.