A command-line application for managing company agencies across different regions of Iran.
This CLI application allows users to manage company agencies. Data is stored persistently in a JSON file.
| Property | Type | Description |
|---|---|---|
| Id | string | Unique identifier |
| Name | string | Agency name |
| Address | string | Physical address |
| PhoneNumber | string | Contact number |
| DateOfMembership | string | Registration date |
| CountOfEmployee | uint16 | Number of employees |
| Region | string | Province/City |
- ✅ Write data to JSON file
- ✅ Read data from JSON file
- ✅ Find agency by ID in a region
- ✅ List all agencies in a region
- ✅ Get complete agency information by ID
- ✅ Create new agency
- ✅ Edit agency by ID
- ✅ Show status (count) of agencies in a region
| Command | Shortcut | Description |
|---|---|---|
list |
l |
List all agencies in a region |
get |
g |
Get agency details by ID |
create |
c |
Create a new agency |
edit |
e |
Edit an existing agency |
status |
s |
Show statistics for a region |
exit |
0 |
Exit the program |
tehran, isfahan, shiraz, mashhad, tabriz, kish, rasht, ahvaz, kerman, yazd, hamedan, qom, karaj, urmia, zanjan, sari, gorgan, ardabil, kermanshah, ilam, khorramabad, sanandaj, qazvin, semnan, birjand, bojnord, zahedan, bandarabbas, bushehr, yasuj, shahrekord, arak
company-agency-cli/
├── go.mod # Module management
├── main.go # Main application file
├── entities/
│ └── agency.go # Agency data model
├── storage/
│ └── json_storage.go # JSON storage operations
├── utils/
│ └── helpers.go # Helper functions
└── README.md # Documentation
# Clone the repository
git clone https://github.com/Sinabehboodi/company-agency-cli.git
# Enter the project directory
cd company-agency-cli
# Build the application
go build -o agency-cli main.go
# Run the application
./agency-cli --command list --region tehran
./agency-cli --command create --region isfahan
./agency-cli --command get --region shiraz
./agency-cli --command status --region mashhad# List agencies in Tehran
./agency-cli --command list --region tehran
# Create a new agency in Isfahan
./agency-cli --command create --region isfahan
# Get agency details (will prompt for ID)
./agency-cli --command get --region shiraz
# Show statistics for Mashhad
./agency-cli --command status --region mashhadSina Behboodi
- GitHub: @Sinabehboodi
- LinkedIn: Sina Behboodinejad