A command-line tool to quickly create new project structures with best practices.
- Create new projects with predefined structures
- Support for multiple programming languages (Python, Go)
- Git repository initialization
- VS Code integration
- Virtual environment setup for Python projects
- Customizable project templates
- Configuration management
- Go 1.21 or later
- Git
- VS Code (optional)
- Clone the repository:
git clone https://github.com/shrine2000/QS
cd QS- Build and install:
make install- Add ~/.local/bin to your PATH (if not already added):
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
# or for zsh:
# echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc- Reload your shell configuration:
source ~/.bashrc
# or for zsh:
# source ~/.zshrcmake uninstallmake cleanBasic usage:
qs my-projectWith flags:
qs -lang python -desc "My awesome project" my-projectAvailable flags:
-lang: Project language (python, go)-desc: Project description-git: Initialize git repository (default: true)-vscode: Open in VS Code (default: true)-venv: Create virtual environment for Python projects (default: true)-config: Configure QS settings
The configuration file is stored at ~/.qs/config.json. Run qs -config to set up your preferences:
- Default project path (default: ~/Documents)
- Default project language
- Git username and email
- VS Code path
Example config.json:
{
"base_path": "/home/user/Documents",
"default_lang": "python",
"git_user": "John Doe",
"git_email": "john@example.com"
}project_name/
├── project_name/ # Main source code
│ ├── __init__.py
│ ├── app.py # Main application code
├── tests/ # Unit tests
│ ├── __init__.py
│ ├── test_app.py # Test cases
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
├── setup.py # Package configuration
└── README.md # Project documentation
project_name/
├── cmd/ # Main applications
│ └── project_name/
│ └── main.go # Entry point
├── internal/ # Private application code
│ └── pkg/ # Internal packages
├── pkg/ # Public library code
├── test/ # Additional test files
├── .gitignore # Git ignore rules
├── go.mod # Go module definition
└── README.md # Project documentation
QS uses a simple interface for templates. To create a new template:
- Create a new file in
pkg/templates/(e.g.,rust.go) - Implement the
Templateinterface:
type Template interface {
Name() string
Description() string
CreateStructure(projectPath, projectName string) error
}- Register your template in
internal/project/creator.go
Example template:
type RustTemplate struct {
BaseTemplate
}
func NewRustTemplate() *RustTemplate {
return &RustTemplate{
BaseTemplate: BaseTemplate{
name: "rust",
description: "Rust project template",
},
}
}
func (t *RustTemplate) CreateStructure(projectPath, projectName string) error {
// Create project structure
return nil
}- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.