A simple CLI application similar to Azure CLI with Azure authentication capabilities
Project description
MyCliApp
A modern Python CLI application similar to Azure CLI with comprehensive Azure authentication capabilities.
Features
-
๐ Multiple Authentication Methods:
- Interactive browser authentication
- Broker-based authentication (Windows Hello, Microsoft Authenticator)
- Device code flow for headless environments
- Azure CLI credential fallback
-
๐ฆ Resource Management: Create, list, and delete resources (demo operations)
-
โ๏ธ Configuration Management: Set and view configuration settings
-
๐จ Colorized Output: Enhanced terminal output with colors and icons
-
๐ Cross-platform: Works on Windows, macOS, and Linux
-
๐พ Persistent Authentication: Saves authentication state between sessions
-
๐ Status Monitoring: Check system status and health
Installation
๐ Quick Start (2025)
From PyPI (Recommended)
# Basic CLI functionality
pip install mycli-app
# With Azure authentication support
pip install mycli-app[azure]
# With enhanced Windows authentication (Windows Hello, Microsoft Authenticator)
pip install mycli-app[broker]
Modern Package Managers
Windows (WinGet)
winget install YourCompany.MyCliApp
Windows (Chocolatey)
choco install mycli-app
macOS (Homebrew) - Coming Soon
brew install mycli-app
Standalone Executable (Windows)
Download from GitHub Releases:
- No Python installation required
- Extract and run
mycli.exe
Development Installation
git clone https://github.com/naga-nandyala/mycli-app.git
cd mycli-app
pip install -e .[dev]
Quick Start
-
Install the package:
pip install mycli-app[azure]
-
Check status:
mycli status -
Login to Azure:
mycli login -
Start using commands:
mycli resource list mycli whoami
Usage
Authentication Commands
# Interactive browser login
mycli login
# Broker authentication (Windows Hello/Authenticator)
mycli login --use-broker
# Device code flow (for remote/headless scenarios)
mycli login --use-device-code
# Login with specific tenant
mycli login --tenant "your-tenant-id"
# Check authentication status
mycli whoami
# View account information
mycli account
# Check broker capabilities
mycli broker
# Logout
mycli logout
Resource Management
# Create a resource
mycli resource create --name "my-vm" --location "eastus" --type "vm"
# List all resources
mycli resource list
# List resources by location
mycli resource list --location "eastus"
# List resources by type
mycli resource list --type "vm"
# Delete a resource (with confirmation)
mycli resource delete "my-vm"
Configuration Management
# Set a configuration value
mycli config set --key "default_location" --value "westus"
# Show all configuration
mycli config show
# Show specific configuration key
mycli config show --key "default_location"
System Commands
# Show system status
mycli status
# Show version
mycli --version
# Show help
mycli --help
# Clear authentication cache
mycli clear-cache
# Clear all cache including MSAL
mycli clear-cache --all
Authentication Storage
Authentication information is stored in:
- Windows:
%USERPROFILE%\.mycli\config.json - macOS/Linux:
~/.mycli/config.json
The stored information includes:
- Authentication status
- User information (user ID, display name)
- Tenant ID (if specified)
- Authentication method used
- Broker capabilities
Note: Actual credentials are managed securely by the Azure SDK and are not stored in plain text.
Command Structure
mycli
โโโ resource
โ โโโ create # Create a new resource
โ โโโ list # List all resources
โ โโโ delete # Delete a resource
โโโ config
โ โโโ set # Set configuration value
โ โโโ show # Show configuration
โโโ login # Authenticate with Azure
โโโ logout # Sign out from Azure
โโโ whoami # Show current user
โโโ account # Show account information
โโโ broker # Show broker capabilities
โโโ status # Show system status
โโโ clear-cache # Clear authentication cache
โโโ --help # Show help
โโโ --version # Show version
Development
Setting up Development Environment
-
Clone the repository:
git clone https://github.com/naga-nandyala/mycli-app.git cd mycli-app
-
Install in development mode:
pip install -e .[dev]
-
Run tests:
pytest
-
Format code:
black src/ -
Type checking:
mypy src/
Building and Publishing
-
Build the package:
python -m build
-
Upload to PyPI (requires credentials):
twine upload dist/*
Configuration Options
The package supports multiple installation configurations:
| Installation | Command | Features |
|---|---|---|
| Basic | pip install mycli-app |
Core CLI functionality |
| Azure | pip install mycli-app[azure] |
+ Azure authentication |
| Broker | pip install mycli-app[broker] |
+ Enhanced Windows authentication |
| Development | pip install mycli-app[dev] |
+ Testing and development tools |
| WinGet | winget install YourCompany.MyCliApp |
Native Windows package manager (2025) |
| Chocolatey | choco install mycli-app |
Windows package manager |
| Standalone | Download from releases | No Python required (Windows) |
Requirements
- Python: 3.8 or higher
- Operating System: Windows, macOS, or Linux
- Optional: Azure subscription for authentication features
Core Dependencies
click>=8.0.0- Command-line interface frameworkcolorama>=0.4.0- Cross-platform colored terminal output
Optional Dependencies
azure-identity>=1.12.0- Azure authenticationazure-mgmt-core>=1.3.0- Azure managementazure-core>=1.24.0- Azure core functionalitymsal>=1.20.0- Microsoft Authentication Library
Example Session
$ mycli status
๐ System Status:
Service: Online
Authentication: Not Authenticated (None)
Azure SDK: Available
Version: 1.0.0
$ mycli login
๐ Starting Azure authentication...
โ Successfully authenticated!
User: your.email@domain.com
$ mycli resource create --name "test-vm" --type "vm"
โ Creating vm resource...
Name: test-vm
Location: eastus
Type: vm
โ Resource 'test-vm' created successfully!
$ mycli resource list
๐ Listing resources...
Name Type Location Status
--------------------------------------------------
myvm-001 vm eastus running
mystorage-001 storage westus active
mydb-001 database eastus running
test-vm vm eastus running
$ mycli logout
๐ Logging out...
โ Successfully logged out!
Error Handling
The application includes comprehensive error handling for:
- โ Missing Azure SDK packages
- โ Authentication failures
- โ Network connectivity issues
- โ Invalid tenant IDs
- โ Permission issues
- โ Configuration problems
Contributing
- Fork the repository
- Create a 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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- ๐ Documentation
- ๐ Bug Reports
- ๐ฌ Discussions
Made with โค๏ธ for the CLI community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mycli_app_naga-1.0.0.tar.gz.
File metadata
- Download URL: mycli_app_naga-1.0.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0242066eb4f82f429f056cd6dee9c9b4f3607ee665ba979e651e38f0ae0cb5d2
|
|
| MD5 |
0648d63b91332a90831e2cc49a82dc04
|
|
| BLAKE2b-256 |
817ad5598332766aa525ae7d1330e7dd95a1f4a802a8adad035334c4232af774
|
File details
Details for the file mycli_app_naga-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mycli_app_naga-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d889bd3fdaebce5e235dcdabd4fd2c240a0fe27638aa2e9b1857c8237b7c81b9
|
|
| MD5 |
933000d96429c6c10938c41a54ca4820
|
|
| BLAKE2b-256 |
1d6e2c252d1b4835f0fc8c661f61d5f2454d8181a60927f246d78249eff63fd6
|