A simple command-line process management application written in Go. This tool provides an interactive CLI for managing processes with basic lifecycle operations.
- Create new processes with custom names
- List all managed processes with their status
- Start processes by ID
- Stop running processes
- Delete processes from the manager
- Interactive command-line interface
- In-memory process tracking
process-manager/
├── main.go # Application entry point
├── cli/
│ └── cli.go # CLI interface and command handlers
├── manager/
│ └── manager.go # Process manager logic
└── process/
└── process.go # Process model and lifecycle methods
- Go 1.25.5 or higher
- Clone the repository:
git clone <repository-url>
cd process-manager- Build the application:
go build -o process-managerRun the application:
./process-managerOnce the application is running, you'll see a ProcessManager > prompt. The following commands are available:
create <process-name>
Creates a new process with the specified name and assigns it a unique ID.
Example:
ProcessManager > create my-app
Created process 1
list
Displays all processes with their ID, name, and current status.
Example:
ProcessManager > list
1 | my-app | stopped
2 | web-server | running
start <process-id>
Starts a process by its ID. The process must be in a stopped state.
Example:
ProcessManager > start 1
stop <process-id>
Stops a running process by its ID.
Example:
ProcessManager > stop 1
delete <process-id>
Removes a process from the manager by its ID.
Example:
ProcessManager > delete 1
exit
Exits the application.
Example:
ProcessManager > exit
bye 👋
-
Process (
process/process.go): Core data structure representing a process with properties like ID, name, status, and creation timestamp. Includes lifecycle methods (Start(),Stop()). -
Manager (
manager/manager.go): Manages the collection of processes. Handles CRUD operations and maintains unique process IDs. -
CLI (
cli/cli.go): Provides an interactive command-line interface. Parses user input and delegates operations to the manager.
[Create] → [Stopped] ⇄ [Running]
↓
[Delete]
go build -o process-managergo run main.gogo test ./...ProcessManager > create database
Created process 1
ProcessManager > create web-server
Created process 2
ProcessManager > list
1 | database | stopped
2 | web-server | stopped
ProcessManager > start 1
ProcessManager > start 2
ProcessManager > list
1 | database | running
2 | web-server | running
ProcessManager > stop 1
ProcessManager > delete 1
<nil>
ProcessManager > list
2 | web-server | running
ProcessManager > exit
bye 👋
- Processes are stored in memory only (data is lost when the application exits)
- Process management is simulated (no actual OS process creation)
- No persistence layer
- Single-user, single-session design
- Persist processes to disk (JSON, database, etc.)
- Add process metadata (resource usage, logs, etc.)
- Implement actual OS process spawning
- Add configuration file support
- Enhance error handling and validation
- Add unit tests
- Support for process groups and dependencies
This project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to get started.