2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cursor CLIのインストール,使い方

Last updated at Posted at 2025-08-07

はじめに

  • 2025年8月7日付でCursor CLIがリリースされた.
  • Claude CodeやGemini CLIと同様,ターミナルから起動できて,対話形式でコードの編集が行える
  • OpenAI系モデルをCLIコーディングAIで(月額定額で)呼び出せるので便利

インストール方法

curl https://cursor.com/install -fsS

このコマンドを実行すると,Webブラウザが立ち上がり,Cursorへのログインページが表示される.
(Windowsネイティブにはまだ対応していないので,WindowsユーザーはWSL経由で.)

インストール後は以下のコマンドでバージョン確認ができる.

cursor-agent --version

使用方法

対話型モードと非対話型モードがある.

対話型モード

通常起動

cursor-agent

初期プロンプトを指定して実行

cursor-agent "find and fix performance issues"

対話型モードでは,入力欄に /model <モデル名>でモデルを指定することができる.

非対話型モード

特定プロンプトとモデルを指定

cursor-agent -p "find and fix performance issues" --model "gpt-5"

git差分付きで表示

cursor-agent --with-diffs -p "review these changes for security issues"

セッション管理

過去のチャット一覧を表示

cursor-agent ls

最新のチャットを再開

cursor-agent resume

特定IDのチャットを再開

cursor-agent --resume="chat-id-here"

まとめ

各社モデルを選んで使えるので好んで使っているCursorだが,今回CLIツールがリリースされたので使い方の外観を調べて備忘録的にまとめてみた.
リモート接続先のシェルを叩くときにも使えるので多用することになりそう.
OpenAIのモデルをCLIツールで使いたい∧従量課金のCodexは使いたくないという方はぜひ試してみてほしい.

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?