Skip to content

Add headless CLI mode to dbibackend - #406

Open
erickreyestorres wants to merge 2 commits into
rashevskyv:mainfrom
erickreyestorres:feature/dbibackend-cli-headless
Open

Add headless CLI mode to dbibackend#406
erickreyestorres wants to merge 2 commits into
rashevskyv:mainfrom
erickreyestorres:feature/dbibackend-cli-headless

Conversation

@erickreyestorres

Copy link
Copy Markdown

Summary

This adds a small CLI layer to dbibackend while keeping the existing GUI behavior unchanged by default.

New options:

  • --no-gui to run dbibackend from terminals/scripts without Tk UI
  • --recursive to add files from folders recursively
  • --filter-installers to only add NSP/NSZ/XCI/XCZ files from folders
  • --help through argparse

Other small robustness improvements:

  • --help works even when PyUSB is not installed yet
  • missing paths are reported instead of crashing
  • duplicate file names are reported instead of silently replacing entries
  • file range transfers log bytes sent and approximate MiB/s
  • unexpected EOF while reading a served file is reported

README.md was updated with the new CLI examples.

Validation

  • python -m py_compile ./dbibackend
  • python ./dbibackend --help
  • python ./dbibackend --no-gui reports No files to serve and exits with code 1 as expected

I could not validate the USB transfer path with a Switch in DBIbackend mode from this environment, so the protocol behavior was kept unchanged except for safer logging/checks around it.

@erickreyestorres

Copy link
Copy Markdown
Author

Added a follow-up commit with unit tests for the new dbibackend path/CLI behavior.

Covered cases:

  • adding a single file
  • case-insensitive installer filtering for NSP/NSZ/XCI/XCZ
  • recursive folder scanning
  • duplicate filename handling without replacing the original entry
  • --no-gui returning an error when no files are provided
  • --no-gui invoking the server path when files are provided, without touching real USB hardware in tests

Validation now includes:

  • python -m unittest discover -s tests -q -> OK, 6 tests
  • python -m py_compile ./dbibackend
  • python ./dbibackend --help

@erickreyestorres

Copy link
Copy Markdown
Author

Also, a small personal note related to this contribution:

We are working on an independent Switch homebrew project inspired by DBI's workflow, focused on a Spanish-friendly MTP transfer/install experience with a more visual UI, clearer per-file results, and better diagnostic logs for failed NSP/XCI transfers.

Project: https://github.com/erickreyestorres/transferencia-switch

We are not trying to misuse DBI or copy private work without permission. If DBI's main program source is available under any license, or if you would be open to authorizing reuse of specific parts, guidance, or collaboration, we would be very grateful. If not, no problem at all: we will continue with an independent clean implementation and use DBI only as functional inspiration.

If any of our UI/reporting ideas could be useful for DBI, we would also be happy to adapt and contribute them in the direction you prefer.

@erickreyestorres

Copy link
Copy Markdown
Author

Bilingual note / Двуязычное сообщение:

English:

We are working on an independent Switch homebrew project inspired by DBI's workflow, focused on a Spanish-friendly MTP transfer/install experience with a more visual UI, clearer per-file results, and better diagnostic logs for failed NSP/XCI transfers.

Project: https://github.com/erickreyestorres/transferencia-switch

We are not trying to misuse DBI or copy private work without permission. If DBI's main program source is available under any license, or if you would be open to authorizing reuse of specific parts, guidance, or collaboration, we would be very grateful. If not, no problem at all: we will continue with an independent clean implementation and use DBI only as functional inspiration.

If any of our UI/reporting ideas could be useful for DBI, we would also be happy to adapt and contribute them in the direction you prefer.

Русский:

Мы работаем над независимым homebrew-проектом для Nintendo Switch, вдохновлённым рабочим процессом DBI. Цель проекта — сделать более удобный для испаноязычных пользователей MTP transfer/install инструмент: с более наглядным интерфейсом, понятными результатами по каждому файлу и более подробными диагностическими логами для неудачных передач NSP/XCI.

Проект: https://github.com/erickreyestorres/transferencia-switch

Мы не хотим неправомерно использовать DBI или копировать закрытую работу без разрешения. Если исходный код основной программы DBI доступен под какой-либо лицензией, либо если вы готовы разрешить использование отдельных частей, дать технические рекомендации или рассмотреть сотрудничество, мы будем очень благодарны. Если нет — никаких проблем: мы продолжим независимую clean-room реализацию и будем использовать DBI только как функциональное вдохновение.

Если какие-либо наши идеи по интерфейсу или отчётам о передаче могут быть полезны для DBI, мы также будем рады адаптировать их и внести вклад в том направлении, которое вы посчитаете правильным.

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

Successfully merging this pull request may close these issues.

1 participant