How to Use OTS from Command-Line:

You can use OTS from a Graphical User Interface (OTS_GUI), or directly from your Command-Line in text-mode. This page covers the Command-Line usage. Otherwise see Graphical Interface Usage.

The command-line methods have corresponding steps similar to the GUI method:

  1. Select a tax program and form-data file (template),
  2. Fill-out the fields,
  3. Save the file to a meaningful name (example "mytaxes.txt"),
  4. Compute your taxes,
  5. Run the auto-fill-out program to produce the PDF forms.

An alternative to using the GUI is to edit the form-data file directly with your favorite text editor, and then invoke the tax programs directly from your command-line. Some users start with the GUI, and then directly edit their files in their favorite text editor. You can use a mixture of both. You may even go back-and-forth between using the GUI and direct command-line operation.

The following and other sections focus on direct text-mode usage of OTS, as well as how it operates.

Warning: It is safer to use the GUI instead of editing form data files directly. If you are not careful, with a text-editor you could accidentally erase a line-ending semi-colon (;) or comment bracket ({}), which gets your file out-of sync. OTS will generate an error message, which you would then need to fix. However, if you understand this, and you generally know how be careful or how to fix things if they break, then using a text editor can provide many advantages over the GUI.

The template files for starting to fill out a new form, as well as helpful example files, are under the examples_and_templates directory of the OTS package. If you want to use the command-line, then you might cd to under that directory, and into the particular form-name you want to do. (Some people copy the given form text-file out of there, to their own place.)
      cd   OpenTaxSolver2016_14.03_linux32/examples_and_templates/US_1040
      gedit   US_1040_template.txt

You can make all your tax entries into the text file with your favorite text editor. (Note that it must be saved as a regular text file; not an MS-Word file, RTF, or any other format.)

Although you will start with a template file, always remember to save it to a new name that is meaningful to you;   Not ...template.

In the form text-files, most line entries consist of:

	Line-label:	numeric-values ;    { comments }
The line-label ensures the values are read into the correct variable. The numeric-values may include commas for placeholders (example: 27,384.00). Multiple numeric-values may be entered before the semicolon (;), which can be entered on separate lines for readability. If multiple values are entered for a given entry, they will be automatically added together for that line entry.


	L7:	47,230.10	{ My W2 }
		12,082.35 ;	{  Spouse's W2 }
	L9:	   613.00	{ Bank interest }
		    41.99	{  Credit Union  }
		   115.03	{  Savings account }

Capital Gains Entries - Federal 1040:
For the US Federal 1040, Capital Gains/Losses are Recorded as:

	buy_cost	date
	sale_value	date
Date is mm-dd-yy, where mm is the two-digit month, dd is the day, and yy is the last two digits of the year. (Yes, this is Y2K proof.)


        -3658.22        12-15-99        { 100 Shares XOM }
         4209.95         1-25-02
The dates are required to apply the proper short-term or long-term capital gains rates on Federal taxes, but are not required for State tax forms.

Capital Gains Entries - State Forms:
For the State Tax forms that require capital gains details, just enter the buy_cost, and sale_amount, with no dates. The form-comments and GUI will prompt you accordingly. Dates are not required, since the states do not distinguish long-term gains.

How to Compute Taxes from Command-line:
The tax program executables are under the bin directory of OTS packages. You can compute your tax answers by running the corresponding tax program on your form text-file.
      bin/taxsolve_US_1040_2016   my_1040_2016.txt

It will produce output to the screen, as well as write the results to a file of the same name, but with "_out.txt" appended.

How to Fill-out PDF Form from Command-line:
The command to create the PDF forms with the older fill-out program was (3 arguments):
      bin/fillout_PDF_forms   tax_results_out.txt   markedform.pdf

The meta-data and marked-up-forms are kept under 'src/formadata".

The newer program is similar:
      bin/universal_pdf_file_modifier   tax_results_out.txt

Both programs print to the screen the name of the PDF file they generate. The name is formed from your tax_results_out file-name, but with .pdf appended. The first pdf fill-out program, fillout_PDF_forms, is used for Fed1040, Sched-C, CA, OH, and VA. The second and newer one, universal_pdf_file_modifier, is used for NY, MA, NJ, and NC. The PDF porgrams are expected to be merged into a common, much more capable program, next year.

Of course, compared to the above examples, you may need to specify the relative paths to the given files. For example, if you wanted to run from the examples_and_templates/US_1040 directory, then the all above commands would be something like:

  cd   OpenTaxSolver2016_14.03_linux32/examples_and_templates/US_1040

  cp   US_1040_template.txt   my1040.txt

  gedit   my_1040_2016.txt

  ../../bin/taxsolve_US_1040_2016   my1040.txt

  ../../bin/bin/fillout_PDF_forms ../../src/formdata/ my1040_out.txt ../../src/formdata/f1040_marked.pdf

Obviously, you wouldn't want to type all this very often. But you could copy&paste it, or place it into a script file.

The above syntax was for Linux/Mac/Unix systems. For Microsoft's CMD window, they would be basically all the same, except all the slashes would be back-slashes (\) instead.

Return to OpenTaxSolver Home