DEV Community

Cover image for I Made AI Code for Me from My Phone (Slack Codex CLI)
M Sea Bass
M Sea Bass

Posted on

I Made AI Code for Me from My Phone (Slack Codex CLI)

Introduction

Have you ever wished you could work while lying in bed?

Well, you can.

I built a system where you just send a mention in Slack, and AI writes the code and even creates a PR (Pull Request) for you. You can request coding from your phone, on the train, or even from your bed.

In this article, I'll show you how this system works and demonstrate it in action.

How It Works

The architecture is simple.

  1. Mention from your phone via Slack → Message goes to Slack Cloud
  2. Bot on your home PC detects it → Python Bot connected via Socket Mode receives the message
  3. Launches Codex CLI → Automatically, Codex CLI does the task you requested
  4. Reports progress to Slack → Sends progress and results to Slack via Slack MCP (Model Context Protocol)
  5. Creates Pull Request on GitHub → Commits and creates Pull Request via GitHub MCP

Since all processing happens on your home PC, you can use GPU and run heavy tasks with Docker.

See It in Action

Let me show you how it actually works.

1. Send a Mention in Slack

Just mention the bot in Slack to start the work.

@codex-bot create simple todo app in new folder and run with host 0.0.0.0
Enter fullscreen mode Exit fullscreen mode

Once the bot starts working, progress updates are posted to the thread. When complete, the app URL and PR(Pull Request) link are shared.

2. Check the App

Access the created app from your phone to verify it works.

If you're on the same WiFi network, you can directly access the development server. Checking the design and giving feedback is easy from your phone.

3. Review and Merge the PR(Pull Request)

Review the PR(Pull Request) on GitHub and merge it if everything looks good.

Check the code diff, add comments if needed, and merge. Done!

What You Can Do

Examples of what this system can do:

  • Coding: Implement new features, fix bugs, refactoring
  • App Development: Create web app scaffolding, adjust UI
  • Docker Tasks: ML training, batch processing (completion detection via health checks)
  • Automated Testing: Simple E2E tests with Playwright MCP

The workflow of "checking app design on your phone while giving feedback via Slack" feels like pair programming with a designer.

Setup

The code is available on GitHub. Setup instructions are in the README.

🔗 Repository: https://github.com/M6saw0/slack_codex_bot

Requirements:

  • Slack App (Socket Mode)
  • ChatGPT Account (for Codex CLI)
  • GitHub Token (for PR creation)

See the repository README for detailed setup instructions.

Conclusion

Once you experience having AI code for you from your phone, you'll be hooked.

  • Request bug fixes while lounging in bed
  • Implement new app features on the train
  • Give design feedback while relaxing on the couch

Make the most of your commute and spare time—build your own AI pair programmer.

Related Links

Top comments (0)