DB Browser for SQLite has a command line interface.

Usage: sqlitebrowser [options] [db or project file]

Possible command line arguments:

Short optionLong optionArgumentDescription
-h—helpShow command line options
-q—quitExit application after running scripts
-s—sql[file]Execute this SQL file after opening the DB
-t—table[table]Browse this table after opening the DB
-R—read-onlyOpen database in read-only mode
-o—option[group/setting=value]Run application with this setting temporarily set to value
-O—save-option[group/setting=value]Permanently change setting to specified value before starting the application
-v—versionDisplay the current version
 [file]Open this SQLite database or project file

Examples

Open a project file using the font DejaVu for the data browser:

sqlitebrowser -o databrowser/font=DejaVu sample.sqbpro

Open the Library DB read-only and browse the table loans:

sqlitebrowser -R -t loans Library.db

Open the Aquariums DB, execute the Aquariums_preload.sql file and quit:

sqlitebrowser -s Aquariums_preload.sql -q Aquariums.db

Settings option

The possible values for the argument of the --option option can be found in the source file Settings.cpp. The provided values are applied only to the current session, but you can enter Preferences for saving them for future sessions.

These are sample values for the 3.11 version using the format:

  1. [group]
  2. setting=value

Note: all the color settings can be specified using hexadecimal notation or by their common names (when recognized).

  1. [%General]
  2. DBFileExtensions=SQLite database files (*.db *.sqlite *.sqlite3 *.db3)
  3. language=es_ES
  4. toolbarStyle=2
  5.  
  6. [checkversion]
  7. enabled=true
  8.  
  9. [databrowser]
  10. bin_bg_colour=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc\xfc\xfc\xfc\xfc\0\0)
  11. bin_fg_colour=@Variant(\0\0\0\x43\x1\xff\xff\xc0\xc0\xc0\xc0\xc0\xc0\0\0)
  12. blob_text=BLOB
  13. complete_threshold=1000
  14. filter_delay=200
  15. filter_escape=\\
  16. font=DejaVu Sans
  17. fontsize=10
  18. null_bg_colour=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc\xfc\xfc\xfc\xfc\0\0)
  19. null_fg_colour=@Variant(\0\0\0\x43\x1\xff\xff\xc0\xc0\xc0\xc0\xc0\xc0\0\0)
  20. null_text=NULL
  21. reg_bg_colour=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc\xfc\xfc\xfc\xfc\0\0)
  22. reg_fg_colour=@Variant(\0\0\0\x43\x1\xff\xff!!!!!!\0\0)
  23. symbol_limit=5000
  24.  
  25. [db]
  26. defaultencoding=UTF-8
  27. defaultfieldtype=0
  28. defaultlocation=/home/mgr
  29. defaultsqltext=
  30. foreignkeys=true
  31. hideschemalinebreaks=true
  32. prefetchsize=50000
  33. savedefaultlocation=2
  34.  
  35. [editor]
  36. auto_completion=true
  37. error_indicators=true
  38. font=DejaVu Sans Mono
  39. fontsize=9
  40. horizontal_tiling=false
  41. identifier_quotes=0
  42. tabsize=4
  43. upper_keywords=true
  44. wrap_lines=0
  45.  
  46. [extensions]
  47. disableregex=false
  48. enable_load_extension=false
  49. list=@Invalid()
  50.  
  51. [log]
  52. fontsize=9
  53.  
  54. [remote]
  55. active=true
  56. client_certificates=@Invalid()
  57. clonedirectory=/home/mgr/.local/share/sqlitebrowser/DB Browser for SQLite
  58.  
  59. [syntaxhighlighter]
  60. background_bold=false
  61. background_colour=#fcfcfc
  62. background_italic=false
  63. background_underline=false
  64. comment_bold=false
  65. comment_colour=#008000
  66. comment_italic=false
  67. comment_underline=false
  68. currentline_bold=false
  69. currentline_colour=#ececf5
  70. currentline_italic=false
  71. currentline_underline=false
  72. foreground_bold=false
  73. foreground_colour=#212121
  74. foreground_italic=false
  75. foreground_underline=false
  76. function_bold=true
  77. function_colour=#0000ff
  78. function_italic=false
  79. function_underline=false
  80. identifier_bold=false
  81. identifier_colour=#800080
  82. identifier_italic=false
  83. identifier_underline=false
  84. keyword_bold=true
  85. keyword_colour=#000080
  86. keyword_italic=false
  87. keyword_underline=false
  88. string_bold=false
  89. string_colour=#ff0000
  90. string_italic=false
  91. string_underline=false
  92. table_bold=true
  93. table_colour=#008080
  94. table_italic=false
  95. table_underline=false