Skip to main content

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.

PyPI version Python Support License: MIT

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

  1. Install the package:

    pip install mycli-app[azure]
    
  2. Check status:

    mycli status
    
  3. Login to Azure:

    mycli login
    
  4. 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

  1. Clone the repository:

    git clone https://github.com/naga-nandyala/mycli-app.git
    cd mycli-app
    
  2. Install in development mode:

    pip install -e .[dev]
    
  3. Run tests:

    pytest
    
  4. Format code:

    black src/
    
  5. Type checking:

    mypy src/
    

Building and Publishing

  1. Build the package:

    python -m build
    
  2. 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 framework
  • colorama>=0.4.0 - Cross-platform colored terminal output

Optional Dependencies

  • azure-identity>=1.12.0 - Azure authentication
  • azure-mgmt-core>=1.3.0 - Azure management
  • azure-core>=1.24.0 - Azure core functionality
  • msal>=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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Made with โค๏ธ for the CLI community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mycli_app_naga-1.0.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mycli_app_naga-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

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

Hashes for mycli_app_naga-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0242066eb4f82f429f056cd6dee9c9b4f3607ee665ba979e651e38f0ae0cb5d2
MD5 0648d63b91332a90831e2cc49a82dc04
BLAKE2b-256 817ad5598332766aa525ae7d1330e7dd95a1f4a802a8adad035334c4232af774

See more details on using hashes here.

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

Hashes for mycli_app_naga-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d889bd3fdaebce5e235dcdabd4fd2c240a0fe27638aa2e9b1857c8237b7c81b9
MD5 933000d96429c6c10938c41a54ca4820
BLAKE2b-256 1d6e2c252d1b4835f0fc8c661f61d5f2454d8181a60927f246d78249eff63fd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page