Communitygithub.com

cli-anything-ollama

Ollama REST APIを介したローカルLLM推論とモデル管理のためのCLIツール。AIエージェントやパワーユーザー向けに設計。

cli-anything-ollama とは?

cli-anything-ollamaは、Ollama REST APIを介してローカルLLMの推論とモデル管理を行うCLIツールです。AIエージェントやパワーユーザーがGUIなしでモデルの管理、テキスト生成、チャット、埋め込み作成を可能にします。主な機能として、モデルの一覧表示、ダウンロード、削除、コピー、テキスト生成、チャット補完、埋め込み生成に対応しています。また、人間が読みやすい出力形式と、AIエージェントが解析可能なJSON出力形式(`--json`フラグ)の両方をサポートしており、スクリプトや自動化ワークフローに組み込みやすい設計です。インタラクティブなREPLモードも備え、対話的な探索やマルチターンチャットが可能です。Python 3.10以上が必要で、Ollamaサーバーが事前に稼働している必要があります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-ollama

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

cli-anything-ollama は何をしますか?

Ollama REST APIを介したローカルLLM推論とモデル管理のためのCLIツール。GUIなしでモデル管理、テキスト生成、チャット、埋め込み作成を行う必要があるAIエージェントやパワーユーザー向けに設計されています。

インストール

このCLIはcli-anything-ollamaパッケージの一部としてインストールされます:

pip install cli-anything-ollama

前提条件:

  • Python 3.10以上
  • Ollamaがインストールされ、実行中であること(ollama serve)

使い方

基本コマンド

# ヘルプを表示
cli-anything-ollama --help

# インタラクティブREPLモードを開始
cli-anything-ollama

# 利用可能なモデルを一覧表示
cli-anything-ollama model list

# JSON出力で実行(エージェント向け)
cli-anything-ollama --json model list

REPLモード

サブコマンドなしで呼び出すと、インタラクティブなREPLセッションが開始されます:

cli-anything-ollama
# タブ補完と履歴を使って対話的にコマンドを入力

コマンドグループ

モデル (Model)

モデル管理コマンド。

コマンド説明
listローカルで利用可能なモデルを一覧表示
showモデルの詳細を表示(パラメータ、テンプレート、ライセンス)
pullOllamaライブラリからモデルをダウンロード
rmローカルストレージからモデルを削除
copyモデルを新しい名前でコピー
ps現在メモリに読み込まれているモデルを一覧表示

生成 (Generate)

テキスト生成およびチャットコマンド。

コマンド説明
textプロンプトからテキストを生成
chatチャット補完リクエストを送信

埋め込み (Embed)

埋め込み生成コマンド。

コマンド説明
textテキストの埋め込みを生成

サーバー (Server)

サーバーの状態と情報のコマンド。

コマンド説明
statusOllamaサーバーが実行中か確認
versionOllamaサーバーのバージョンを表示

セッション (Session)

セッション状態のコマンド。

コマンド説明
status現在のセッション状態を表示
history現在のセッションのチャット履歴を表示

例

モデルの一覧表示とダウンロード

# 利用可能なモデルを一覧表示
cli-anything-ollama model list

# モデルをダウンロード
cli-anything-ollama model pull llama3.2

# モデルの詳細を表示
cli-anything-ollama model show llama3.2

テキスト生成

# テキストをストリーム表示(デフォルト)
cli-anything-ollama generate text --model llama3.2 --prompt "量子コンピューティングを一文で説明してください"

# 非ストリーミングでJSON出力(エージェント向け)
cli-anything-ollama --json generate text --model llama3.2 --prompt "こんにちは" --no-stream

チャット

# シングルターンチャット
cli-anything-ollama generate chat --model llama3.2 --message "user:Pythonとは何ですか?"

# マルチターンチャット
cli-anything-ollama generate chat --model llama3.2 \
  --message "user:Pythonとは何ですか?" \
  --message "user:JavaScriptとどう比較されますか?"

# JSONファイルからのチャット
cli-anything-ollama generate chat --model llama3.2 --file messages.json

埋め込み

cli-anything-ollama embed text --model nomic-embed-text --input "こんにちは世界"
cli-anything-ollama embed text --model nomic-embed-text --input "こんにちは" --input "世界"

インタラクティブREPLセッション

探索的な使用のためにインタラクティブセッションを開始します。

cli-anything-ollama
# 対話的にコマンドを入力
# 利用可能なコマンドを表示するには 'help' を使用

リモートホストへの接続

cli-anything-ollama --host http://192.168.1.100:11434 model list

状態管理

CLIは軽量なセッション状態を維持します:

  • 現在のホストURL:--hostで設定可能
  • チャット履歴:REPLでのマルチターン会話のために追跡
  • 最後に使用したモデル:REPLプロンプトに表示

出力形式

すべてのコマンドは2つの出力モードをサポートしています:

  • 人間可読(デフォルト):テーブル、色付き、整形されたテキスト
  • 機械可読(--jsonフラグ):エージェントが消費するための構造化JSON
# 人間向け出力
cli-anything-ollama model list

# エージェント向けJSON出力
cli-anything-ollama --json model list

AIエージェント向け

このCLIをプログラム的に使用する場合:

  1. 解析可能な出力のために常に--jsonフラグを使用
  2. リターンコードを確認 - 0は成功、0以外はエラー
  3. エラー発生時はstderrを解析してエラーメッセージを取得
  4. generate/chatでは--no-streamを使用して完全なレスポンスを取得
  5. 他のコマンドの前にserver statusでOllamaが実行中であることを確認

詳細情報

  • 完全なドキュメント:パッケージ内のREADME.mdを参照
  • テストカバレッジ:パッケージ内のTEST.mdを参照
  • 方法論:cli-anything-plugin内のHARNESS.mdを参照

バージョン

1.0.1

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

関連スキル