Skip to main content

Prototype implementation of context deltas in Python

Project description

Quick start

  1. Activate the project virtualenv (expected at .venv):
    source .venv/bin/activate
    
  2. Install the package (PyPI想定) or editable mode:
    # PyPI (予定)
    pip install context-delta-proto
    # またはローカルeditable
    pip install -e .
    
  3. Create or point to a .env with model/provider config, then run the CLI:
    delta --help
    delta "READMEを要約して"               # チャット(デフォルトはフルオート)
    delta --manual "READMEを要約して"      # 承認付きチャット
    delta read_file --file "$(pwd)/some.txt" --offset 1 --limit 10 --indent
    delta list_dir --dir "$(pwd)" --offset 1 --limit 20 --depth 2
    delta --plan-file plan.json "planに従って進めて"  # Planを注入してチャットを開始
    

Chat mode defaults to auto-approval (Codex風フルオート)。承認を入れたいときは --manual を付けるか、各ツールサブコマンドで --yes を外して実行してください。

Plan駆動で進める場合:

  • delta --plan-file plan.json "planに従って進めて" でplanを注入。--max-stepsで完了ステップ数を制限できる。
  • plan更新時は update_plan{"plan":[...全ステップ...]} をそのまま渡す。apply_patchは *** Begin Patch/*** End Patch 形式で与える。

.env / 環境変数の例

# モデル/プロバイダ
MODEL=openai/gpt-oss-20b        # gpt-5* なら OpenAI、その他は LMStudio/Ollama を自動判定
OPENAI_API_KEY=sk-...           # OpenAIを使う場合
LMSTUDIO_BASE_URL=http://localhost:1234
OLLAMA_BASE_URL=http://localhost:11434

# Web検索
SEARCH_PROVIDER=tavily          # 例: tavily / mock
SEARCH_API_KEY=tvly-dev-...

.env は起動時に読み込まれ、環境変数より優先されます。

よく使うサブコマンド

  • delta "prompt": チャット(フルオート)。--manualで承認付き。--max-turnsでターン制限。
  • delta read_file --file <abs> --offset 1 --limit 20 --indent: 行番号なしで抜粋。
  • delta list_dir --dir <abs> --depth 2 --limit 20: ツリー表示(.git/ignoreはデフォルト除外)。
  • delta shell_command --workdir <abs> "cmd": シェルコマンド(確認付き、--yesでスキップ)。
  • delta exec ...: 非対話のローカル実行。
  • delta --plan-file plan.json "planに従って進めて": planを注入してステップ実行。

apply_patchのフォーマット(重要)

ファイル作成/編集は必ず *** Begin Patch ... *** End Patch 形式を使用し、Add/Update ブロックの中に先頭+付きで内容を書くこと。

update_planの呼び出し

常に全ステップを含む JSON({"plan":[...全ステップ...]})を渡してください。ステップ内容が曖昧な場合は、実行前に質問してから進めるように誘導すると安定します。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_delta_proto-0.0.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_delta_proto-0.0.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file context_delta_proto-0.0.1.tar.gz.

File metadata

  • Download URL: context_delta_proto-0.0.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for context_delta_proto-0.0.1.tar.gz
Algorithm Hash digest
SHA256 24d2d79d2edd17e7c75b1fa99e34cdd1496fda2a7817b1742cfbfc8c5a9649db
MD5 fcc4dea62a17c7d27593d6f63670b9ad
BLAKE2b-256 373af89edccffec640ecb4c828f74a648b751966824f2eec89f936f9989f1a17

See more details on using hashes here.

File details

Details for the file context_delta_proto-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_delta_proto-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 705cbd4771074584339294fd1f681e65bafbdd4c0ca9e3df894dda8f7c13c778
MD5 4503ed25d9d1cc3a6ff2f93dbfe25435
BLAKE2b-256 402f1d2f7968232eb602065632a66fa7cd2742aa54db411be284175da786d515

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page