0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Raspberrypiとiphoneを接続してコーディングエージェント開発環境を整える

Posted at

概要

ihoneから操作して開発ができる環境が欲しいと思って、コーディングエージェントを環境を整えるため、RaspberryPiを使って環境構築したいと思います。

デバイス

 $ cat /sys/firmware/devicetree/base/model; echo
Raspberry Pi 4 Model B Rev 1.2

$ uname -m
aarch64

セットアップ全体像

  • iPhoneのTailscale → 自宅ラズパイのTailscale IPへSSH
  • 作業継続:ラズパイ側で tmux
  • 編集:vim
  • Codex CLIのセットアップ

ラズパイセットアップ

Tailscale

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

認証画面へのアクセスが求められるため、ログインして認証を完了させる。

To authenticate, visit:

        https://login.tailscale.com/a/xxxxxxxx

Success.

tmuxをインストール

継続して作業を進められるように、tmuxをインストールします。

sudo apt update
sudo apt install tmux

iPhoneのセットアップ

SSHアプリ

Termiusをインストールします。

New Hostから、新しい接続情報を作成します。

  • Label: pi
  • IP or Hostname:
  • UseSSH: On
  • Port: 任意のポート

作成後、iPhoneから起動すると、Raspberrypiに接続できる。

Codexをインストール

codexをインストールする。

npm i -g @openai/codex

codexを実行する

                                      
              __+=++++=+,_            
          _=""\+/;/+\+;++"**+_        
        ,\'\,+*-*"`` `"*~*+|,*|,      
      _|"*+____            '*~\"|     
     ,/_;\'|\`\,.             ^\.*    
     / ,/`  *_ "|/,            "\^*   
    | ;!`     !\ "\\            |^|,  
    ||\~      _\ _//!           \| |  
    |'"|     // ,*"',++_+++++_  |\~|  
     _*|\  ,|__/~/ !`~_______|| \/'`  
     ' *|\ +_+/^     "**^^^^^" |,"/   
      ',"\;.                 ,/|"/    
        \/||+~,           ,++"/,`     
          *,_"**=^;~_+~;"-",;+'       
            `*+/~_,,_,,++**"          
                                      

  Welcome to Codex, OpenAI's command-line coding agent

  Sign in with ChatGPT to use Codex as part of your paid plan
  or connect an API key for usage-based billing

> 1. Sign in with ChatGPT
     Uses device code login (headless environment detected)

  2. Provide your own API key
     Pay for what you use

  Press Enter to continue

指示に従って、ログインする。今回は、1でサインインする。

$ codex

おわり

スマホでコーディングエージェントの環境構築完了

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?