Getting Started¶
Get up and running with txeh in under 5 minutes.
Install the CLI¶
Download the latest release from GitHub Releases for your platform.
Your First Commands¶
Add a hostname:
List hosts for an IP:
Remove a hostname:
Preview changes without saving (dry run):
Use as a Go Library¶
Add the dependency:
Basic usage:
package main
import (
"fmt"
"github.com/txn2/txeh"
)
func main() {
hosts, err := txeh.NewHostsDefault()
if err != nil {
panic(err)
}
hosts.AddHost("127.0.0.1", "myapp.local")
fmt.Println(hosts.RenderHostsFile())
err = hosts.Save()
if err != nil {
panic(err)
}
}
Next Steps¶
- CLI Reference: Full CLI documentation.
- Go Library: Detailed library usage.
- API Reference: Complete type and method reference.