Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file in local directory? #408

Open
xpe opened this issue Feb 26, 2025 · 1 comment
Open

Configuration file in local directory? #408

xpe opened this issue Feb 26, 2025 · 1 comment

Comments

@xpe
Copy link

xpe commented Feb 26, 2025

I see mention of a home directory configuration file, but I didn't see any mention of a way to point xh to a configuration file in a local directory. Did I miss it?

Why: I'd like to reuse a bunch of command flags for a particular project.

@blyxxyz
Copy link
Collaborator

blyxxyz commented Feb 27, 2025

You can't point it directly to a file but you can set the XH_CONFIG_DIR environment variable to override the ~/.config/xh/ location of the config.json file and sessions dir.

If you're only looking to add command flags (and you don't need to be cross-platform between Unix/Windows) then you could also consider a wrapper script:

#!/bin/sh
exec xh --some --flags --here "$@"

And if the only flags you need are for authentication/headers then you can use session files: https://httpie.io/docs/cli/sessions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants