Question: I want to write a command.

This is the example the commands should achieve:

```
\begin{alignat}{1}
Hello \\
Hello two \\
Hello three
\end{alignat}{1}

```

This should the commands look like:

```
\mycommand {
\command{Hello}
\command{Hello two}
\command{Hello three}
}

```

\mycommand has one argument and this will include a list of commands.
It will put a `\begin{alignat}{1}` before all commands and a `\end{alignat}{1}` after all commands. Between each of the commands it will insert a `\\` (after the last command no `\\` is inserted and this is the difficult part).

In this example the `\command` is

```
\newcommand{\command}[1]{#1}

```

The Question is how do i write `\mycommmand`

Answer: 
Here is an implementation of `\mycommand` and `\command` that provides what you're after:

![enter image description here](https://i.stack.imgur.com/TjpL1.png)

```
\documentclass{article}
\usepackage{amsmath}
\begin{document}

Some text before.
\begin{alignat}{1}
  \text{Hello} \\
  \text{Hello two} \\
  \text{Hello three}
\end{alignat}
Some text after.

\noindent
\hrulefill

\newcommand{\mycommand}[1]{%
  \begin{alignat}{1} #1 \end{alignat}%
}%

Some text before.
\mycommand{
  \text{Hello} \\
  \text{Hello two} \\
  \text{Hello three}
}%
Some text after.

\noindent
\hrulefill

\makeatletter
\renewcommand{\mycommand}[1]{%
  \begin{alignat}{1} #1\null \end{alignat}%
}%
\def\@afterfi#1\fi{\fi#1}%
\newcommand{\command}[1]{\text{#1} \@ifnextchar\null{}{\\}}%
\makeatother

Some text before.
\mycommand{
  \command{Hello}
  \command{Hello two}
  \command{Hello three}
}%
Some text after.

\end{document}

```

An additional `\null` token is inserted at the end of `\mycommand`'s argument, and used as a check in `\command` using [`\@ifnextchar`](https://tex.stackexchange.com/q/57788/5764).
This adds a `\\` after each token in the argument.

```
\ExplSyntaxOn
\NewDocumentCommand\mycommand{m}
 {
  \tl_map_inline:nn {#1} {##1\\}
 }
\ExplSyntaxOff

```