config works

This commit is contained in:
venus
2026-04-05 23:31:32 -05:00
parent 7e88b51db6
commit b208cc2ddb
3 changed files with 18 additions and 1 deletions

View File

@@ -4,7 +4,9 @@ version = "0.1.0"
description = "An AI enhanced CTF toolchain"
readme = "README.md"
requires-python = ">=3.14"
dependencies = []
dependencies = [
"platformdirs>=4.9.4",
]
[build-system]
requires = ["hatchling"]

View File

@@ -3,8 +3,10 @@
import argparse
from ctf import commands
from ctf import utils
def main():
print("Hello from ctf!")
utils.load_config()
commands.test()

13
src/ctf/utils.py Normal file
View File

@@ -0,0 +1,13 @@
# src/ctf/utils.py
# basic utilities
import tomllib
from pathlib import Path
from platformdirs import user_config_dir
# Parse config file
CONFIG_DIR = Path(user_config_dir("ctf")) #config directory is $XDG_CONFIG_HOME/ctf/
CONFIG_DIR = Path("/home/venus/code/ctf/")
CONFIG_FILE = CONFIG_DIR / "config.toml"
def load_config():
print(CONFIG_FILE)