Skip to main content

Manage /etc/hosts entries from the command line

Project description

hostctl

Manage /etc/hosts entries from the command line. Add, remove, enable, disable, and look up host entries with ease.

Install

pip install hostctl-cli

Usage

# List all entries
hostctl list
hostctl list --all          # Include disabled

# Look up a hostname
hostctl lookup myapp.local

# Add an entry (requires sudo for /etc/hosts)
sudo hostctl add 127.0.0.1 myapp.local api.local -c "dev environment"

# Remove entries
sudo hostctl remove myapp.local

# Disable (comment out) without removing
sudo hostctl disable myapp.local

# Re-enable
sudo hostctl enable myapp.local

# Use a custom hosts file
hostctl -f ./hosts.test list

# JSON output
hostctl --json list

For AI Agents

See SKILL.md for agent-optimized documentation.

Features

  • List, add, remove, enable, disable host entries
  • Look up hostnames
  • JSON output (--json) for automation
  • Custom hosts file support (-f)
  • Dry-run mode for add/remove
  • Automatic backup before writes
  • Preserves comments and formatting

License

MIT

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

hostctl_cli-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

hostctl_cli-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file hostctl_cli-0.1.0.tar.gz.

File metadata

  • Download URL: hostctl_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hostctl_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65ec77f6ba34c08e29a3d2414e68c83b886ca657105726dfe2a2d1bfa4caadee
MD5 655442d2ae93b13fb7eb544d9a0af157
BLAKE2b-256 5b112649109f44edf86b4ed3ba6536ef573035535293c807a648b3f30e112a44

See more details on using hashes here.

File details

Details for the file hostctl_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hostctl_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hostctl_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b42e575d1a4483f63fd7cd2709c93cb260dfef555fca02deeef9fba1fda3bc24
MD5 e33c7beef6476515254eab585dd716a7
BLAKE2b-256 e95ca6eebc72159e53d1119e9531e840da7328def43cc9a64041e1ae31ec565d

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