A terminal-based chat application with OpenAI integration that also supports SSH access.
- Chat with OpenAI models directly from your terminal
- Access the chat application via SSH
- Stylish TUI interface using Bubble Tea
- Clone the repository
- Set the required environment variables:
export OPENAI_API_KEY=your_openai_api_key export OPENAI_MODEL=gpt-4-turbo # or another OpenAI model export OPENAI_BASE_URL=https://api.openai.com/v1 # Optional, defaults to OpenAI's API
- Generate SSH keys for the server:
./generate_ssh_key.sh
To run the application directly in your terminal:
go run .
To run the application as an SSH server:
go run . -ssh
By default, the SSH server runs on port 2222. You can change this by setting the SSH_ADDR
environment variable:
export SSH_ADDR=:2223
go run . -ssh
Connect to the running SSH server using:
ssh -p 2222 localhost
To build the application:
go build
Then run it:
# Direct terminal mode
./sshtalk
# SSH server mode
./sshtalk -ssh
You can run the application using Docker:
# Build the image
docker build -t sshtalk .
# Run in direct terminal mode (interactive)
docker run -it --rm -e OPENAI_API_KEY=your_api_key -e OPENAI_MODEL=gpt-4-turbo sshtalk
# Run in SSH server mode
docker run -d -p 2222:22 -e OPENAI_API_KEY=your_api_key -e OPENAI_MODEL=gpt-4-turbo sshtalk
To run with Docker Compose:
# Create a .env file with your API key and model
echo "OPENAI_API_KEY=your_api_key" > .env
echo "OPENAI_MODEL=gpt-4-turbo" >> .env
# Start the services
docker-compose up -d
This project uses GitHub Actions for continuous integration and delivery. On every push to the main branch or when a new tag is created, the workflow automatically:
- Builds a Docker image
- Pushes the image to GitHub Container Registry (ghcr.io)
To use the container images from the registry:
docker pull ghcr.io/USERNAME/sshtalk:latest
Replace USERNAME
with your GitHub username.
When creating a new release, tag your commit with a version number (e.g., v1.0.0
) and the workflow will automatically build and publish a versioned Docker image.